Hey all. I am having trouble with terrain. I know that there are several ways of doing this i.e. Fractal, Fault, Isometric, Particle Deposition. I would like to make one using Fractal or Fault generation. The only problem is that I don''t know where to start.. I have some algorithims on them, but I need some help implementing them to OpenGL...so..if anyone could help..just a basic overview of how it''s done would be great!
Yours Truly,
Cory
Just use your algorithms to create a triangle mesh, which you then pass to OpenGL to render.
-----------------------
0wn 0wn 0wn your goat
gently down the pw33n
-----------------------
0wn 0wn 0wn your goat
gently down the pw33n
just buy "Game Programming Gems" (Mark Deloura). The first book has very good articles about it, but they are a bit hard to understand.
1 - Generate a heightmap
2 - Generate triangle strips from heightmap
You''ve been reading about number 1. Number 2 is probably easier. Here''s the simplest way. Each row of your terrain is a triangle strip. Add the verteces to the list in the following order:
2___4 __6___8|\ |\ |\ || \ | \ | \ | ...I''m sure you can see the pattern!|__\|__\|__\|1 3 5 7
Send each of these as a GL_TRIANGLE_STRIP to OpenGL.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement