Greetings fellow mortals,
I want to make a tile-based 3D terrain in Irrlicht. Terrain would be made of rectangular tiles (each made of two three-pointed vertices). Each such tile could have a specific texture.
It would be great if I could add static lightning on the terrain. By static I mean that lightning does not need to change once the map is made, but I would like to have lightning so that it is easier to tell height variations (hills would have darker and lighter sides).
It would be great if I could tell easily what tile the user has clicked with mouse.
I believe Irrlicht does not support such terrain so I would have to code it myself. Could I code such terrain with Irrlicht and would it make sense (be easy enough)? Should I use some other 3D engine instead?
Thanks for your time.
Making 3D tile-based terrain?
-
- Posts: 8
- Joined: Fri Oct 13, 2006 3:12 pm
Citizen Spintz,Spintz wrote:Irrlicht has everything you need except the tiled terrain. Lightmaps are provided.
In order to do picking of terrain tiles you would either have to make each tile it's own node, or do some custom picking after you created your tiled terrain node.
Thank you for your advice. Mystic Jimbo much appreciates. I think making each tile a node of its own sounds good.
Would a high number of nodes cause speed issues in itself (if we forget speed issues caused by rendering a good number of vertices)? For example if I had a 100x100 map I would get 10 000 nodes.
How would I go on creating this system? I am all new to Irrlicht and it is a bit hard for me to interpret the docs. Should I make a custom SceneNode like in tutorial number 3?
I think you must only generate visible terrain node (alos for exemple 25*30 tiles) and reaffect the texture on the fly when your move our terrain change...
i have the same problem and want code the same terrain generation as you
i have the same problem and want code the same terrain generation as you
L'eternité c'est long, surtout vers la fin...
Q6600 triton 79, 4 GO, 2* RAPTOR 150GO of ARECA 256 RAID 0, 3870 Zalmann, P5K. 24" Samsung. Antec nine hundred
Q6600 triton 79, 4 GO, 2* RAPTOR 150GO of ARECA 256 RAID 0, 3870 Zalmann, P5K. 24" Samsung. Antec nine hundred
-
- Posts: 8
- Joined: Fri Oct 13, 2006 3:12 pm
Citizen AmigaIrr,
My tiles have height variations, so it is easier for me to keep each tile a node of its own. Irrlicht seems fast enough to handle all the nodes.
Currently I do lights by adjusting vertice colors. Next I'll add some billboards for trees and see how it looks.
Ah, just found out that I can't make them billboards. Will make them child nodes for tile nodes instead.
My tiles have height variations, so it is easier for me to keep each tile a node of its own. Irrlicht seems fast enough to handle all the nodes.
Currently I do lights by adjusting vertice colors. Next I'll add some billboards for trees and see how it looks.
Ah, just found out that I can't make them billboards. Will make them child nodes for tile nodes instead.
-
- Posts: 8
- Joined: Fri Oct 13, 2006 3:12 pm
Howdy,
You use BlitzMax like I do, right?
Use custom node tutorial as base.
Make an array that holds height of each tile. Make an array that holds a node for each tile.
Adjust Verctices.insert and indicies.insert lines so that each node is a rectangular tile.
Adjust values in Vertices.insert lines so that they adjust Y of each vertice according to values in the height array.
Use _SCOLOR of vertices for making dark sides of hills dark, and light sides light (use height array for figuring out when a node is on a dark or light side).
Note that each node has same X and Z values for vertices. Tiles get drawn at different parts of the scene by positioning the nodes themselves at different positions.
You will need to create a new method for the custom node in which you set the vertices, so that you can easily change the height anywhere in the code.
Here's a screenshot of very basic terrain.
You use BlitzMax like I do, right?
Use custom node tutorial as base.
Make an array that holds height of each tile. Make an array that holds a node for each tile.
Adjust Verctices.insert and indicies.insert lines so that each node is a rectangular tile.
Adjust values in Vertices.insert lines so that they adjust Y of each vertice according to values in the height array.
Use _SCOLOR of vertices for making dark sides of hills dark, and light sides light (use height array for figuring out when a node is on a dark or light side).
Note that each node has same X and Z values for vertices. Tiles get drawn at different parts of the scene by positioning the nodes themselves at different positions.
You will need to create a new method for the custom node in which you set the vertices, so that you can easily change the height anywhere in the code.
Here's a screenshot of very basic terrain.