Jump to content
  • Advertisement
Sign in to follow this  
vcGamer

moving camera on terrain

This topic is 3158 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 friends I'm using VC++ 6 (I know it is not any more supported) and DX9, I want to move my FPS camera on top of my terrain (I make my terrains using 3d MAX, or I'll use height maps), how can I find height of each triangle & put my camera exactly above it so that it simulates walking a man on a terrain (I have n FPS camera), if I use heightmaps the solution is somehow straightforward but in case of meshes I'm in a deadlock. thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
For meshes, you can "shoot" a ray downward from somewhere above the player's position, using D3DXIntersect() to get the distance from where you shoot the ray to the surface of the mesh.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!