Sign in to follow this  
GPxz

Walking in a irregular terrain

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 this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
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

Any help would be cool, i still feel a little unsecure about this

Share this post


Link to post
Share on other sites
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].

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this