Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Moving a character across dynamic terrain

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

I was curious if anyone had any general ideas on how this is normally implemented, such as in the 3D Mario and Zelda games... The terrain''s y values vary across the landscape, and I assume that as the character moves, his/her y value must update according to the position of the landscape he/she is on. But how would you dynamically calculate the y-value for the position of the terrain mesh that the character is currently standing on? I haven''t really programmed anything yet.. just thinking. I''m planning on using DirectX''s X Files to import meshes of these objects. Thanks for your speculations! -Riskbreaker

Share this post

Link to post
Share on other sites
from what I can tell, most just use collision detection of the player''s bounding volume (such as a sphere, ellipse, or box) with all of the terrain''s triangles, as opposed to calculating terrain height at a given point.

warning - uncertain of following method
if you do want to your method, however, it shouldn''t be too difficult. just use the x-z position to find which triangle he''s standing on and use a weighted average of the heights of the 3 vertices to get your player''s height.
end warning

hope that helps

''There''s something out there....something stupid...''
- Daria

DirectInput8 with the Keyboard , DirectInput8 with the Mouse , Using DirectX Audio 8

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!