Sign in to follow this  
Meshboy

Terrain Bounds

Recommended Posts

In my previous FPS game i made a complete mesh in Blender that was my level, a big mesh with rooms and stuff. all with 90 degree angle. because of the angle i could use boxes (vector4) with values that was representeing where the player could move and som vector4 with values that represented bounds (tables, chairs etc) This is the only way i know for making a level with bounderies for the player. Now i am making a new Game and i wonder if there is a better way to do this? If its not to complicated i would have outside terrain where there are some hills and other stuff, and not only straight angles. any suggestions?

Share this post


Link to post
Share on other sites
Just out of curiousity, why did this end up in DirectX? I moved a very similar thread of yours from here to 'Maths & Physics' a few days ago... Guess where this one is going [wink]

You need to define how your data is to be represented before you can tackle this problem with any specific detail.

Simplifying your terrain to being a perturbed plane (aka "height map") makes things very easy - both physics and rendering. However it trades this in against being slightly less flexible (e.g. overhangs and caves become difficult to represent).

If you take this route then you'll either be using a "higher order surface" that you can compute the derivatives of in order to work out changes of elevation (useful for moving an object over a surface), or you can just run a complex ray/plane intersection. Alternatively, if you take the conventional "height map" approach you just need to determine which cell the ray intersects on and solve a simple ray-plane test on the potential list of triangles it intersects.

If you want a more general surface made out of arbitrary polygonal data then you're back to using general "collision mesh" and other collision detection algorithms. As was briefly suggested in a reply to your other thread.

Terrain rendering is a well covered subject and what you describe is a common problem. A bit of searching around the internet should reveal plenty of examples.

hth
Jack

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