Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Selecting Objects in 3D

This topic is 6493 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

This problem has probably already been answered before, but I''ve been having trouble with the search page for this forum. The basic problem is this: I have a point and click interface where I need to be able to do 2 things. Select objects from 3D space using an orthographic cursor location, and to be able to select points on the level data using similar restraints (walk-to commands). I''m aware that gluUnproject will give me a solution of sorts, but that''s not an option for me for the following reasons: I don''t use a depth buffer for the level data, as I store all that information in a BSP tree to avoid lagging my program with a z buffer, plus I have surfaces that use blending for transparency and reflection. gluUnproject doesn''t give the correct 3D space coords. X and Y coords are fine, but it tends to have a signifigant error factor for the Z coord, which gets bigger the farther along your viewing fustrum you are. So I''ve decided to use a Ray-Poly intersection method but I''ve run into a problem. How do I take a 2D orthographic screen coord and divine the correct ray from it? Another consideration is that the scene has camera rotations and transformations to further complicate things. Also my Ray-Poly algorithm takes a Ray-Plane intersection and checks to see if the point of intersection is within the bounds of the poly (always a convex triangle). Is there a better way? Thanks ----------------------------- Mice are an excellent source of mice.

Share this post

Link to post
Share on other sites
It seems like I always end up posting answers to my own question 5 minutes later

Anyhow here's a solution I found from another forum (over at openGL.org) that I found easy to understand and straightforward. I don't know if it can be optimized or not, but it's a start:


Mice are an excellent source of mice.

Edited by - Jo on October 7, 2000 4:40:36 PM

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!