Jump to content
  • Advertisement

Archived

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

Syrillix

Drag selecting??

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

well as the subject implies im trying to figure out how to drag selecting in 3d. my first idea was to transform the position vectors of the visible set of objects into screen space and test if they lie in the box formed by the drag. my other idea is to create a "box" by calculating the ray from each point formed by the drag and extending the rays out to the zfar distance and test the positions against the box. anyone have any suggestions on this?

Share this post


Link to post
Share on other sites
Advertisement
If you''re using OpenGL you can use GL_SELECTION render mode to get a list of primitives inside the specified screen rectangle.
http://www.opengl.org/developers/faqs/technical/selection.htm

Another popular way that works in OpenGL or DX is to render the selected rectangle of your scene into a buffer, assigning each primitive a 32-bit identifier for its color and using flat shading. Then you can scan through the resulting buffer and pick out all the different id''s present.

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.

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

Sign me up!