Archived

This topic is now archived and is closed to further replies.

The bottom line on terrains

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, What''s the deal with creating terrains in DirectX IM, I need to make levels, what''s the best way import them from .x files or create them right a runtime someway. ? ? Please respond.

Share this post


Link to post
Share on other sites
Why don''t you read some tutorials on gamedev or flipcode ?
You''ll find what you need, probably...

Anyway a popular technic is to use heightmaps with the ROAM algorythm.
I''m testing tesselated auto LOD bezier patch...

Use your brain and you''ll find plenty of ways of deeling with terrain


-* So many things to do, so little time to spend. *-

Share this post


Link to post
Share on other sites
I use my brain for school, this is suppose to be fun. That and I don''t have much time. ;o)

Share this post


Link to post
Share on other sites
The easiest way is to use height maps on a grid of polygons. So say you have a grid of triangles like this:

-------------------
|/|/|/|/|/|/|/|/|/|
|/|/|/|/|/|/|/|/|/|
|/|/|/|/|/|/|/|/|/|
|/|/|/|/|/|/|/|/|/|
|/|/|/|/|/|/|/|/|/|
|/|/|/|/|/|/|/|/|/|
|/|/|/|/|/|/|/|/|/|
--------------------

You could have a corresponding heightmap like so:

-------------------
0000000000000000000
0111111111111111110
0122222222222222210
0123333333333333210
0122222222222222210
0111111111111111110
0000000000000000000
--------------------

Which could be used to figure out the height of each vertex on the triangle grid.

Generating the height maps is really simple also -- you could simply create them as a grayscale bitmap, or whatnot. Hope that helped .

----------------------------------------
"Before criticizing someone, walk a mile in their shoes.
Then, when you do criticize them, you will be a mile away and have their shoes." -- Deep Thoughts

"If you have any trouble sounding condescending, find a Unix user to show you how it's done." - Scott Adams

Share this post


Link to post
Share on other sites
You can not make vertical slopes with ehight maps though can you? Is there a better way to make a terrain than with height maps since they don''t support stuff like cliffs (reverse inclines) and walls (vertical slopes).

Share this post


Link to post
Share on other sites
quote:
Original post by SteveBrown

You can not make vertical slopes with ehight maps though can you? Is there a better way to make a terrain than with height maps since they don''t support stuff like cliffs (reverse inclines) and walls (vertical slopes).


True, it really depends on what you need. Most games don''t need reverse inclines, so heightmaps are generally OK to use.

As an alternative, though, you could simply make it as a mesh in a modelling program and load it in. It''d probably be simpler to do it that way if you have a lot of indoor scenes, anyway. The only problem is that I imagine it makes in game level of detail adjustments extremely hard.

----------------------------------------
"Before criticizing someone, walk a mile in their shoes.
Then, when you do criticize them, you will be a mile away and have their shoes." -- Deep Thoughts

"If you have any trouble sounding condescending, find a Unix user to show you how it's done." - Scott Adams

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Scooter
I use my brain for school, this is suppose to be fun.



uhhhhh.. then why are you programming? you''re not gonna be able to do much without using your brain.

Share this post


Link to post
Share on other sites
quote:

You can not make vertical slopes with ehight maps though can you? Is there a
better way to make a terrain than with height maps since they don''t support stuff
like cliffs (reverse inclines) and walls (vertical slopes).



I like the loading it in as a separate mesh method. You could then put your
cliff mesh ontop of your heightmap terrain as if it belongs there. Knowing
how to interact with it would be another problem.

Share this post


Link to post
Share on other sites
In general would it be better though to use DrawPrim. to create the entire terrain or load a mesh ?? which is the fastes way?

Share this post


Link to post
Share on other sites
You are seriously asking a generalized question concerning immediate mode DirectX programming on GameDev, and expecting some results.

Dude that''s too complicated go buy a really thick DirectX 3-D book instead on amazon.com hehe

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Scooter,
considering you don''t really have much experience with terrain rendering, you should start with simple heightmaps, like Senshi suggested. to speed things up, you might want to look into vertex buffers or something.

once you''ve got a good heightmap going, you can work on LOD/adaptive terrain stuff.

Share this post


Link to post
Share on other sites