Skip to main content
gamedev.net
🔒 Locked

D3DXIntersect

Started by darkzim Jan 20, 2005 at 4:02 PM 2 replies 1.2k views
Original Post
darkzim
darkzim
How do I use D3DXIntersect to place my (1st person) camera on the floor of my level (a .x mesh) and check if it's about to collide with the level? Is D3DXIntersect even the best way to go about doing this?
---------------------------------darkzim
dave
dave
Two Scenarios:

If your floor is an irregular surface, which wouldmost likely be a mesh then you may want to look into D3DXMeshIntersect().

If your floor is a flat surface then you can just give your floor a thin bounding box, like a wafer. Then you can check whether the y coordinate of your camera lies inside the bounding box.

To be honest, if the floor isnt that iregular, like in modulation between the highs and the lows then u could even use a bounding box for that.

Hope this helps.

ace
darkzim
darkzim
It says on msdn that D3DXInersect "Determines if a ray intersects with a mesh." is D3DXIntersect and D3DXMeshIntersect one and the same or something?
---------------------------------darkzim
dave
dave
Maybe i got the names wrong.

But to be honest they arnt needed if the floor is simple enough.

ace

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.