Advertisement

Mouse intersection with the map

Started by March 10, 2000 01:17 PM
0 comments, last by HangMan 24 years, 7 months ago
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
a
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.

This topic is closed to new replies.

Advertisement