Hi community,
i made another example: How to use the addTerrainMesh-command
and how to change Height and colors.
For the example in this case we dont display a "normal" terrain, instead we display a Mandelbrot set.
http://zenprogramming.tripod.com -> in the Download-section below
if you like please send me a mail :-)
Example for addTerrainMesh and change height/colors
-
- Posts: 199
- Joined: Sun Aug 24, 2003 5:47 pm
- Location: Germany
-
- Posts: 292
- Joined: Sun Mar 14, 2004 5:28 pm
- Location: Germany
- Contact:
hmm, sounds interessting, i'll download it
http://www.games-forge.de - Die Community für Nachwuchsprogrammierer
-
- Posts: 292
- Joined: Sun Mar 14, 2004 5:28 pm
- Location: Germany
- Contact:
Looks very good (movement.exe) but terrible source! Most cpp ides make it possible to spread your code over more then one source file
http://www.games-forge.de - Die Community für Nachwuchsprogrammierer
Thanks for the interesting examples. I modified one function though so you can set the alpha of the terrain. (you have to set EMT_TRANSPARENT_VERTEX_ALPHA for the material but I assume you already knew that)
Code: Select all
void setColor(IAnimatedMesh* terrain, int x, int z, s32 Alpha, s32 Red, s32 Green, s32 Blue)
{
buffer = terrain->getMesh(0)->getMeshBuffer(0);
v = (S3DVertex*)buffer->getVertices();
v[x+z*mapHeight].Color.set(Alpha,Red,Green,Blue);
}
-
- Posts: 199
- Joined: Sun Aug 24, 2003 5:47 pm
- Location: Germany
@Romul: Thank you very much! Yes in the other test below the addTerrainMesh-Example i used the Alphavalue and know it, but your third function belongs good to the other two.
@Peter: You mean the "texturelayer-test with alphablending", not the "addTerrainMesh-Example with Mandelbrot". Yes, the code is a little spagetti, thats cause i called it only a "test" not an "example" ;-)
@Peter: You mean the "texturelayer-test with alphablending", not the "addTerrainMesh-Example with Mandelbrot". Yes, the code is a little spagetti, thats cause i called it only a "test" not an "example" ;-)
-
- Posts: 292
- Joined: Sun Mar 14, 2004 5:28 pm
- Location: Germany
- Contact:
oh, i looked into madelbrot, thats cool, too, but _much_ better source
http://www.games-forge.de - Die Community für Nachwuchsprogrammierer
No problem. I hope it benefits the community because I know ive learned alot from your examples already.
Im also more interested in terrain than BSP maps etc because I think random generation is the way to go in games, well atleast my game/s.
Anyway, I hope to post something usefull too eventually. Keep up the good work!
Im also more interested in terrain than BSP maps etc because I think random generation is the way to go in games, well atleast my game/s.
Anyway, I hope to post something usefull too eventually. Keep up the good work!