Jump to content
  • Advertisement
Sign in to follow this  

2D Window Selecting 3D World Coordinates

This topic is 4063 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

My Source Code: www3.telus.net/warrenwang/sampleengine.zip 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: http://nehe.gamedev.net/data/articles/article.asp?article=13 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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!