mouse pointer
If I have several 3D objects in my game, how can I tell which one my mouse is clicking on ? I will have several to many 3D objects and when I click on one, I want it selected so I can click on another area and have it move there. Kinda like command and conquere but 3D. Any help ?
If you''re using OpenGL, use the GL_SELECT render mode and gluPickMatrix (I think that''s what the function''s called). Pick up a copy of the latest GL Superbible: it''s covered quite well, including many other game-oriented concerns.
I am using Direct 3D. Open GL would be easier to use then direct 3D but my vid card supports very little openGL.
by the way: my vid card is ATI Rage Pro........do not ever think of getting an ATI card
Can anyone solve my prob in direct3d ?
by the way: my vid card is ATI Rage Pro........do not ever think of getting an ATI card
Can anyone solve my prob in direct3d ?
surely someone has an idea ?
"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
Just bumping the message up on the recent board....hoping someone will know something.......
I''ve been thinking and thinking but can''t come up with a solution
I''ve been thinking and thinking but can''t come up with a solution
Hey man! I think I know how to help you out!
Just cycle through all the polygons in the terrain, check if the screen coordinates of the mouse cursor are inside the screen coordinates of the triangle it is mapped to on the screen. Go from near to far, and you will get the closest visible area of land that they clicked on. Works great.
How do you figure if a point is in a triangle, you ask? Well, I answered a message a while back from someone asking that very same question on the General Game Programming forum, do a search for "clockwise" and "inside" and "triangle" and such. Should be pretty easy to implement
Hope I helped,
~BenDilts( void );
Just cycle through all the polygons in the terrain, check if the screen coordinates of the mouse cursor are inside the screen coordinates of the triangle it is mapped to on the screen. Go from near to far, and you will get the closest visible area of land that they clicked on. Works great.
How do you figure if a point is in a triangle, you ask? Well, I answered a message a while back from someone asking that very same question on the General Game Programming forum, do a search for "clockwise" and "inside" and "triangle" and such. Should be pretty easy to implement
Hope I helped,
~BenDilts( void );
Hey man! I think I know how to help you out!
Just cycle through all the polygons in the terrain, check if the screen coordinates of the mouse cursor are inside the screen coordinates of the triangle it is mapped to on the screen. Go from near to far, and you will get the closest visible area of land that they clicked on. Works great.
How do you figure if a point is in a triangle, you ask? Well, I answered a message a while back from someone asking that very same question on the General Game Programming forum, do a search for "clockwise" and "inside" and "triangle" and such. Should be pretty easy to implement
Hope I helped,
~BenDilts( void );
Just cycle through all the polygons in the terrain, check if the screen coordinates of the mouse cursor are inside the screen coordinates of the triangle it is mapped to on the screen. Go from near to far, and you will get the closest visible area of land that they clicked on. Works great.
How do you figure if a point is in a triangle, you ask? Well, I answered a message a while back from someone asking that very same question on the General Game Programming forum, do a search for "clockwise" and "inside" and "triangle" and such. Should be pretty easy to implement
Hope I helped,
~BenDilts( void );
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement