Walking in a irregular terrain

This topic is 3839 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

How to make caracther correctly walk in irregular terrains (like heightmaps)? I have one idea how to do it, but i'd like to hear how ppl usually do it if its like the way i am wondering [Edited by - GPxz on November 21, 2007 12:49:03 PM]

Share on other sites
2D or 3D?
If 3D, Heightmap, procedural, arbitrary meshes or something else?
If 2D, bitmap-mask, block-based or what?

Share on other sites
Quote:
 Original post by TheAdmiral2D or 3D? If 3D, Heightmap, procedural, arbitrary meshes or something else?If 2D, bitmap-mask, block-based or what?

Sorry for dont being specific, its for 3D, it can be for any 3d, but lets say, heightmap

Share on other sites
Cool, such a common thing like terrain walking, and information on it is poorly documented

If you are on the top of a triangle vertex, just set to the triangle vertex height, if youre inside the triangle, interpolate between the triangle vertexs height to get the correct height on that position

Share on other sites
Umm, giving some more read there seems to be a more faster and elegant way

Knowing the x and y, you can retrieve the Z using the plane equation

Share on other sites
Quote:
 Original post by GPxzKnowing the x and y, you can retrieve the Z using the plane equation

You can determine the Z from the X and Y on a heightmap or plane system in a constant-time operation. But if the terrain is made up of arbitrary bounding meshes, then you need a per-object, per-primitive interpolated method, which is far slower in general. The reason I asked which layout you're using is that each one requires a very different approach (for optimal performance). I only listed the most common, but there are several ways to represent your terrain.

There is a lot to learn, and it's probably not worthwhile trying to understand it all at once. I recommend you pick a single, simple representation and get it working. Once you're confident with local heightmaps, for example, you can move on to the next representation. In particular, get a good understanding of heightmaps (if that's your representation of choice) and learn to render them successfully. Once that's done, you'll have a much easier time with the corresponding physics.

By the way, I apologise if you felt my original reply was a little terse [wink].

Share on other sites
Quote:
Quote:
 Original post by GPxzKnowing the x and y, you can retrieve the Z using the plane equation

You can determine the Z from the X and Y on a heightmap or plane system in a constant-time operation. But if the terrain is made up of arbitrary bounding meshes, then you need a per-object, per-primitive interpolated method, which is far slower in general. The reason I asked which layout you're using is that each one requires a very different approach (for optimal performance). I only listed the most common, but there are several ways to represent your terrain.

There is a lot to learn, and it's probably not worthwhile trying to understand it all at once. I recommend you pick a single, simple representation and get it working. Once you're confident with local heightmaps, for example, you can move on to the next representation. In particular, get a good understanding of heightmaps (if that's your representation of choice) and learn to render them successfully. Once that's done, you'll have a much easier time with the corresponding physics.

By the way, I apologise if you felt my original reply was a little terse [wink].

Dont know what you mean exactly with bounding meshes, but i will try the Z incognita plane equation method and i think it will be enough, since i am using triangles. I have been thinking about it for a time, and it looks pretty robust for dealing with not only heightmap, but for any planar polygons

I have rendered heightmaps a long time ago, so i dont have problems with this part

• 16
• 9
• 13
• 41
• 15