Advertisement

Moving a character across dynamic terrain

Started by September 15, 2002 08:35 PM
0 comments, last by Riskbreaker 22 years, 5 months ago
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
--RiskbreakerCoding Soul
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

This topic is closed to new replies.

Advertisement