Sign in to follow this  

moving camera on terrain

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

This topic is 2851 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this