point

Another floating point question

I have read most of the posts on here regarding floating point, and I understand the basic underlying issue that using IEEE 754 (and just by the nature of storing numbers in binary) certain fractions cannot be represented. I am trying to figure out the following: If both Python and JavaScript use the IEEE 754 standard, why is it that exe...

Solving a cubic to find nearest point on a curve to a point...

Ok, I have a projectile that has its position defined such that: a.x = initialX + initialDX * time; a.y = initialY + initialDY * time + 0.5 * gravtiy * time^2; I want to be able to predict which obstacles in my environment this projectile will collide with. I plan on checking the distance from A the closest point on the curve to th...

Approximate a R2 line by a set of points

Hi there. I'm working on an application with statistic analysis, and I need some help. Given a set of n points, how can I approximate a line by them. I'm sure there is an algorithm but I couldn't find it. Thanks! ...

Non-Rigid Body 2D Physics Engines in C++

Hey, I'm trying to experiment with 2D physics engines in C++. So far, it seems the most popular is Box2D. Unfortunately, Box2D is a rigid body physics engine and that's not really going to help me with what I want to try. I want to be able to define a shape which has a number of vertices joined by springs, such that when this shape col...

Why is glClear() so slow with point sprites on iPhone?

I am trying to draw point sprites with OpenGL ES on iPhone. It's possible there could be very many of them (1000) and up to 64 pixels wide (maybe that's my problem right there - is there a limit or could I be using too much memory?) I am using CADisplayLink to time the frames. What happens is that the first gl drawing function tends to ...

Draw a point a set distance away from a base point

Hey, I'm trying to figure out an algorithm for finding a random point a set distance away from a base point. So for example: This could just be basic maths and my brain not working yet (forgive me, haven't had my coffee yet :) ), but I've been trying to work this out on paper and I'm not getting anywhere. Thanks, Niall. ...

Displaying different icon sizes on different BlackBerry devices

I'm trying to dynamically set a different icon based on device. I have set up an alternate entry point within the app's descriptor XML file. It passes an argument of "icon" into main() of my application. The entry point is triggered as expected (installing the app and on power cycle), but it has issues when calling updateIcon() on certa...

Do OpenGL Point Sprites work in Android?

I'm developing on a Droid, version 2.1-update1. My supported GL extensions include GL_OES_point_sprite and GL_OES_point_size_array. I am unable to get point sprites to render. The code below throws UnsupportedOperationException from GLWrapperBase at the glTexEnvi call. If I disable textures and comment out the glTexEnvi all, it t...

iPhone: detect any point in a rect in another rect

Is there any way to detect if any point in a given rect is contained inside of another, larger, rect? I'm trying to figure out when certain rects are on the screen (for memory management to deallocate the ones that aren't) but the rects are large and so sometimes only parts of them will be on the screen but I still need to have them load...

Determine which side of a line a point lies.

Hey guys, I've got a line (x1,y1) and (x2, y2). I'd like to see if point (x3, y3) lies to the "left" or "right" of said line. How would I do so? ...

Textured points in OpenGL ES 2.0?

I'm trying to implement textured points (e.g. point sprites) in OpenGL ES 2.0 for a particle system. Problem I'm having is the points all render as solid black squares, rather than having the texture properly mapped. I have verified that gl_PointCoord is in fact returning x/y values from 0.0 to 1.0, which would map across the entir...

How to use pydev extension point in eclipse?

For example: add own functional in pydev package explorer, use pydev python code parser. ...

Shortest distance between point and path

Hi, for a geo-based online game I'm looking for an algorithm which finds the shortest distance between a specified point and a known path connected by x/y-coordinates, so that I can kill all redundant points/nodes. A link or keyword for this algorithm would help me a lot! thanks for reading For better understanding: ...

How to trace NaN in C++

I am going to do some math calculations using C++ . The input floating point number is a valid number, but after calculations , the resulting value becomes NaN. I would like to trace the point where NaN value appears (possibly using gdb), instead of inserting a lot of isNan() into the code. But, I found that even code like this wil...

QT c++ draw point qpainter qgraphicscene

Hell-o all, Im new to qt and I am having trouble drawing one single point. I have a big qMainWindow that eventually calls a QgraphicsScene and inside of it I need to draw a single point, one little pixel, that is all I want, I want to use a QPainter but Im having trouble instantiating one. Any ideas?? ...

Finding Whether A Point is Within a Right-Angle Triangle

I've always wondered the easiest way to figure out whether or not a point lies within a triangle, or in this instance, a rectangle cut into half diagonally. Let's say I have a rectangle that is 64x64 pixels. With this rectangle, I want to return a TRUE value if a passed point is within the upper-left corner of the rectangle, and FALSE ...

How to set up a new Access Point in Android phone, programmatically?

I have searched alot on this but could not find anything on google or stack overflow. ...

AS3 Change registration point of a MovieClip to be center of width and bottom

Hello! I have a MC in an AS3 animation and I want to increase its height from bottom to top which would mean that the registration point should be bottom of the MC and center of width (horizontal center). How can I do this please? Thank you. ...

Direction angle or pointing a 3D angle to a position in space.

Hello. I'm trying to point an entity to a 3D vector. (basically setting an entities angle so it points to a position in 3D space). At the moment, I'm stuck with getting an angle from a vector. //Vectors in the bracket are 3D, first is the entity position, second is a position in space where I want to point at. ( myEntity.Pos - posToPoi...

Remove point from Delaunay Triangulation

Hello, I try to understand how a point from a delaunay triangulation can be removed. I read some scientific papers but i didn't get it totally. As I am not a native speaker I think I would benefit from a more simple and direct explanation. I already implemented a dynamic delaunay triangulation based on a english description, so I know t...