Jump to content
  • Advertisement

Archived

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

HangMan

Mouse intersection with the map

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

Hi there! Got a pig problem. I have a tile-based terrain, for a 3D game, and I have to get the intersection of the mouse with the map. I have the intersection of the mouse with the plain z=0. But the tiles may have different heights, and some of these heights might appear before the mouse intersects the z=0 plain. So, how can I determine where the camera - mouse has intersected the map for the first time. Any sugestion would be useful. Thank you

Share this post


Link to post
Share on other sites
Advertisement
Hey just an idea don''t shoot me if it blows...

Ok awhile back there was a message asking how to find out if a point is within a triangle. Look it up and get the routine. Then cycle through your terrain polys from near to far and see which one the cursor is inside of first, and make sure it''s facing toward you (use its normal or whatever). Hope it helps.

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!