OpenGL Wobbles
I'm writing a routine within my openGL game to project a point on the screen without using an openGL perspective transform. To test accuracy I also draw an openGL projected point onscreen, with the same 3d coordinates. The problem is that my projected point and the openGL point are not always in the same place onscreen. In fact, they only meet in the center and every 240 pixels in x or y. (half my y screen res). The points are never more than about 10 pixels apart, so I know there isn't anything drastically wrong, but I can't seem to work out what is causing this. Can anybody help me with this please?
I use the current modelview matrix to find the relative x,y and z of the point.
The code I use to get the screen coords is
//rade=radians to degrees conversion multiplier
screen.fovy=(60.0/rade)/screenSize.y;
screen.x=(screenSize.x/2)+(atan2(matrix[12],-matrix[14]) /screen.fovy);
screen.y=(screenSize.y/2)+(atan2(matrix[13],-matrix[14]) /screen.fovy);
Edited by - benjamin bunny on 3/1/00 11:00:38 AM
____________________________________________________________www.elf-stone.com | Automated GL Extension Loading: GLee 5.00 for Win32 and Linux
Ok, I''ll rephrase the question.
How exactly does openGL get its screen coordinates from modelview matrix transformed eye coordinates? If anyone can help me with this I''ll be a happy bunny
How exactly does openGL get its screen coordinates from modelview matrix transformed eye coordinates? If anyone can help me with this I''ll be a happy bunny

____________________________________________________________www.elf-stone.com | Automated GL Extension Loading: GLee 5.00 for Win32 and Linux
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement