Walking in a irregular terrain

Started by
5 comments, last by GPxz 16 years, 5 months ago
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]
My MSN: gerunbaum@hotmail.com
Advertisement
2D or 3D?
If 3D, Heightmap, procedural, arbitrary meshes or something else?
If 2D, bitmap-mask, block-based or what?
Ring3 Circus - Diary of a programmer, journal of a hacker.
Quote:Original post by TheAdmiral
2D 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
My MSN: gerunbaum@hotmail.com
Cool, such a common thing like terrain walking, and information on it is poorly documented

After reading some random comments texts around google, i think i got it,

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
My MSN: gerunbaum@hotmail.com
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

Any help would be cool, i still feel a little unsecure about this
My MSN: gerunbaum@hotmail.com
Quote:Original post by GPxz
Knowing 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].
Ring3 Circus - Diary of a programmer, journal of a hacker.
Quote:Original post by TheAdmiral
Quote:Original post by GPxz
Knowing 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
My MSN: gerunbaum@hotmail.com

This topic is closed to new replies.

Advertisement