Sign in to follow this  

2D Window Selecting 3D World Coordinates

Recommended Posts

My Source Code: I am currently trying to make a mini engine for my portfolio and for kicks =). I'm currently at the point where I want to start selecting objects in the world. I have used nehe's tutorial: which led me to an interesting problem. When I go from window space to world coordinates the positions of intersection with the polygons are inconsistent. My source code is written in VC++ 6.0 using glut. Open by opening v2.dsw. The code requires png headers and libraries which are included in their respective directories. If you compile the code and click on my height mapped polygons the errors are displayed in the console window. My terrain heights are all either 0,1 or 1.5 but the y values of the intersections contain some sort of round off error? (problem 1) The same thing happens if I just draw a simple 64,64 polygon from the origin. Secondly, The x and z coordinates as specified in nehe's algorithm (which is presume is correct as everyone is using it) calculate to some other values which are sometimes negative even when I click on a valid polygon in the positive x positive z plane (problem 2). I know this is a common problem. I'm thinking that I'm missing some sort of offset. If anyone is kind enough to help that would be great! Thanks, chibitotoro [Edited by - chibitotoro0_0 on May 4, 2007 10:18:50 AM]

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this