Tiled terrain scene node
I just made an 'endless' terrain by entering the other side as I leave a side.
Of course, It flickers a bit at the transition, but not as bad as I expected.
Maybe I can disguise it with some fog.
However, the important thing is, you never see the terrain edge.
Unless the camera is real high.
In which case,simply move back the transition point.
Of course, It flickers a bit at the transition, but not as bad as I expected.
Maybe I can disguise it with some fog.
However, the important thing is, you never see the terrain edge.
Unless the camera is real high.
In which case,simply move back the transition point.
-
- Posts: 3
- Joined: Sun Dec 31, 2006 4:22 am
Arras
I appreciate the warm welcome, and the time you took to reply. I think I'm finally starting to grasp the basics of this.
Regarding map creation, I see that you're creating a random terrain. Where does the map data go? Is it simply constructed in memory only to evaporate when closed? Is there a way to create a permanent map, and manually add patches of textures to specific parts?
For example: The terrain is all "grass" tiled, but I have a "dirt" tile I want to place patch of on a hill top, and I want it to always be there.
Thank you very for helping out! Sorry to badger you with silly questions.
- Aardaerimus
Regarding map creation, I see that you're creating a random terrain. Where does the map data go? Is it simply constructed in memory only to evaporate when closed? Is there a way to create a permanent map, and manually add patches of textures to specific parts?
For example: The terrain is all "grass" tiled, but I have a "dirt" tile I want to place patch of on a hill top, and I want it to always be there.
Thank you very for helping out! Sorry to badger you with silly questions.
- Aardaerimus
isIrrNewb(true);
HLFat >> on creation, all normals of terrain vertices point up x,y,z=0,1,0
smoothNormals recalculate normals acording to position of vertices around to point in 90 degree angle to terrain in that place. You can notice it on some slope for example.
Normals are important only for one thing in Irrlicht: they afects how light afects vertices of your node. In order to se diference make sure lighting is turned to true for terrain (should be default) and place some dinamic light at the position angled to terrain.
In demo you can see darker polygoons on slopes which are facing away from light source. If smoothNormals function would not be used afther terrain was generated all polygoons would be lit in the same way.
Aardaerimus >> map data are stored in "data" array created in memory with new in constructor and removed with delete in destructor. So basicly they disapear once class stop to exist.
If you want to preserve data in your program you need to store them somewere else. Howe to store them is up to you. I suggest using another array similar to one used by TlTerrain class. To get acces to data use functions getHeight() and getNormal(). There is no function to get UV coordinates of tiles (may be it would be good idea to add one) so you must store that since the begining.
To place your "dirt" on some tile of your terrain use setTileUVs function. Both grass and dirt must be part of one texture however. Look at terrain.bmp texture in Data folder of demo.
smoothNormals recalculate normals acording to position of vertices around to point in 90 degree angle to terrain in that place. You can notice it on some slope for example.
Normals are important only for one thing in Irrlicht: they afects how light afects vertices of your node. In order to se diference make sure lighting is turned to true for terrain (should be default) and place some dinamic light at the position angled to terrain.
In demo you can see darker polygoons on slopes which are facing away from light source. If smoothNormals function would not be used afther terrain was generated all polygoons would be lit in the same way.
Aardaerimus >> map data are stored in "data" array created in memory with new in constructor and removed with delete in destructor. So basicly they disapear once class stop to exist.
If you want to preserve data in your program you need to store them somewere else. Howe to store them is up to you. I suggest using another array similar to one used by TlTerrain class. To get acces to data use functions getHeight() and getNormal(). There is no function to get UV coordinates of tiles (may be it would be good idea to add one) so you must store that since the begining.
To place your "dirt" on some tile of your terrain use setTileUVs function. Both grass and dirt must be part of one texture however. Look at terrain.bmp texture in Data folder of demo.
-
- Posts: 24
- Joined: Sun Apr 09, 2006 8:19 pm
i played around a little bit with the headers being able to add tangents and binormals to the terrain (using the calculation used in the mesh manipulator). a thing made me wonder was that there was not a big difference visible on the FPS count if you use parallax mapping on the terrain.. with the normal ITerrainSceneNode there is a big difference between parallax mapping and none. (might be because the geomorphing lacks in parallax mapping)
Irrlicht 1.2
Has anyone had any troubles compiling and/or running this with 1.2?
I get a compile error: c:\GameDevelopment\irrlicht-1.2\include\vector2d.h(58): error C2668: 'sqrt' : ambiguous call to overloaded function
Also when I run the .EXE demo it starts up and loads and then crashes before it displays the terrain...
I am using visual studio 2003.
Sorry if I missed reading a post about this...
I get a compile error: c:\GameDevelopment\irrlicht-1.2\include\vector2d.h(58): error C2668: 'sqrt' : ambiguous call to overloaded function
Also when I run the .EXE demo it starts up and loads and then crashes before it displays the terrain...
I am using visual studio 2003.
Sorry if I missed reading a post about this...
Belshamaroth >> I have no idea why is it fasther since I don't know howe ITerrainSceneNode realy works. My code is not based in any way on it. It was rather developed from Custom Scene Node Example.
HLFat >> I plan to make my own water surface node which should be similar in principle to TlTerrainSceneNode. However right now I have lot of work and not too much free time for that so it probably not gona be soon.
rs199483 >> yes it was already discused here, try to read posts bmade by lug, it should help.
HLFat >> I plan to make my own water surface node which should be similar in principle to TlTerrainSceneNode. However right now I have lot of work and not too much free time for that so it probably not gona be soon.
rs199483 >> yes it was already discused here, try to read posts bmade by lug, it should help.