Hit-Testing?
I''m trying to write a model editor for game models.
However, I''ve got a problem. For an editor, I need to integrate a "Hit-Testing"-Function, with which I can check, which Vertex or Triangle a User has selected.
Any Ideas?
- Alhexx
Two(ish) ways: OpenGL picking (don''t know much about this, never used it) and ray/primitive.
The ray method basically involves transforming the 2D coordinate of the mouse (or whatever pointer) on the viewport into 3D space, then creating a ray from that point out into the world. That ray is then tested against all the objects using ray/triangle, ray/edge or even ray/point (or ray/whatever primitive you want) intersection tests.
The ray method basically involves transforming the 2D coordinate of the mouse (or whatever pointer) on the viewport into 3D space, then creating a ray from that point out into the world. That ray is then tested against all the objects using ray/triangle, ray/edge or even ray/point (or ray/whatever primitive you want) intersection tests.
May 12, 2003 04:52 AM
One more way: Render your scene using key colors for the objects and retirieve the color at the mouse loc.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement