Jump to content
  • Advertisement
Sign in to follow this  
alnite

practical solution for picking/selecting objects?

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

I searched on Google and read some articles about picking objects in 3D, but I still can't decide which method I should use. I want to do not only picking, but selection as mouse moving, and possibly group picking as well for future projects. Is OpenGL picking good enough for this? Should I go with ray-intersection method?

Share this post


Link to post
Share on other sites
Advertisement
I would say just do it the way you know you can do it, and decide for yourself.

A ray intersect method could be more portable I guess - but why do it the hard way if you know the way you've got in mind should work and you understand it?

Share this post


Link to post
Share on other sites
loads of ways to do this.

Ray-intersection, if you want to code a ray-casting algorithm. Not hard, but it takes time. YOu'll also need some frustum clipping, for drag selection.

Another way is to use the OpenGL feedback system. either, render each object or groups of interest with a single unique and plain colour (no transparency, no lighting, no texture, nothing), see what colour you get underneath the pixel, that will give you the object.

Set the viewport to the pixel, or the area you are interested in. Use the feedback systems from OpenGL/DirectX9, which will tell you if an object has passed various render stages (especially the clipping stage), how many polygons have been drawn, ect...

I'd favor the last solution, quick, simple, hassle-free.

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.

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!