Similar Threads
1. OpenGL Transforming coordinate frames
Hi,
I've having a *small* problem with a small simulation/game I'm trying
to write in C++ using OpenGL. I'm not sure if I need to include code
yet, as it might just make things more complicated, but I can do so if
necessary.
Basically what I'm writing involves a simple sprite fielder trying to
catch a thrown ball. The ball and the fielder are each in their
respective coordinate frames, and I'm using the matrix stack to keep
track of these. I'm also using a camera with gluLookAt(). The user
picks some initial settings like power and release angle, and the balls
trajectory and landing position is calculated. I can plot this landing
spot correctly as long as I stay within the ball's coordinate frame.
What I would like to do is have my fielder go to the position that the
ball will land to catch it. However, I can't seem to get this to work
right. I have the coordinates that the ball is going to land, and I
need to somehow transform them into coordinates that the fielder "can
understand". I would like the fielder to be able to calculate a path
to the ball using several different algorithms. So basically I just
want to make sense of the ball's landings coordinates. I try saving
the model_view matrix of the ball and then loading it back, but somehow
when I plot the point it's not int he right location. It seems to me
to be just simple matrix multiplication, but I'm having a problem
somewhere. Does the camera need to be considered in these
calculations? I've also had a couple of futile efforts at using
gluUnproject + project, but to no avail. Can anyone give me any info,
or refer me some where where I can see some examples? Any help or
advice is welcomed. Thanks.
-Matt
2. Transforming texture coords while using transformed vertices
3. openGL coordinates and Windows mouse coordinates
Hi!
I'm an openGL beginner.
Working under Windows, I've used the glut library to create a simple window.
It seem that, for mouse in this window, the origin coordinate system is
in the upper left corner,
while (default) openGL draw the geometry using as origin the lower left
corner.
So I've used a code like this:
GLint viewport[4];
glGetIntegerv(GL_VIEWPORT, viewport);
//wx and wy are the mouse coordinates
x=wx y=viewport[3]-wy. //mouse windows coordinates converted in
standard openGL coordinates
My questions are:
this problem of Y axis orientation happen only in Windows or it's under
Linux and OSX too? It happen because GLUT?
This is important because the application should be portable...
thx,
Manuel
4. Computing 3d coordinates from texture coordinates
5. Is there a simple way to transform window coordinates to opengl coordinates ?
Is there a simple way to transform window coordinates to opengl
coordinates ?
6. Understanding Transformed and UnTransformed Coordinate Systems
7. Coordinate transforming function for 2-d graphics
I'm in need of a coordinate transforming function to convert from
graphical coordinate to absolute calculations. I believe the
difference I noticed may be due to the aspect ratio.
Does anyone know where I might the formula for a coordinate
transformation function for that would make the graphical and absolute
calculations equivalent
for 2-d graphics.
8. Getting x,y coordinates on a perspective transformed plane