Jump to content
  • Advertisement
Sign in to follow this  
Pathfynder

player model to terrain question

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

Hey guys, In my off time I've been learning what I can about game development, and I'm at the point to where I have terrain, a fairly useful camera and an animated model (you couldn't imagine how stoked I am over each individual peice (although, i wouldn't refer to it as an "engine", that'd be an insult to those who've built real engines)). What i'm trying to do now is attach my player to the terrain, so that it doesn't fall through the bottom of the screen and that it walks nicely accross the sloping terrain - attaching trees/grass was pretty easy, as long as i stayed on the verticies (because I already knew where they were). I'm not sure which direction i should go with researching how to do this, so what do ya'll think? If i'd have to guess: I could cast a ray in the direction of gravity and do collision detection on the terrain's polygons? Or, is their a better way? I'm not looking for code, just common methods and practices for these types of things. Thanks for any guidance, T

Share this post


Link to post
Share on other sites
Advertisement
I'm guessing that your terrain is a height-map based technique?

If so, get the heights of the four terrain vertices closest to the player and do a weighted average between them.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!