New Tiled Terrain Scene Node [works with Irr 1.5]

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
FlyingIsFun1217
Posts: 219
Joined: Fri Apr 13, 2007 8:29 pm
Location: Illinois
Contact:

Post by FlyingIsFun1217 »

hybrid wrote:But of course you need a Linux version of the .a file - or none at all. It is usually best to simply link the .o files of your app with the libIrrlicht.a. Making a static library from your app does not really make sense.
So compile all .o files (with g++ -c ...) and link all .o files with Irrlicht and the rest of the libraries as in the example Makefiles
Wait...
What do I need to do? I assume that the library file (.a) stores all of the class information and such, as that was the error message I was getting.

Here's what the makefile says to build Irrlicht:
# Irrlicht Engine 1.3

# Makefile for Linux, created by N.Gebhardt.

#

# To use, just run:

#

# make

#

# This will compile Irrlicht, create a static lib (libIrrlicht.a), and copy it

# into the subdirectory lib/Linux. That's all.

#

# If you want Irrlicht to be compiled as shared lib (libIrrlicht.so.versionnumber), then run:

#

# make sharedlib

# make install

#

# Please note that Irrlicht as shared lib is just experimental and

# probably not tested.
Thanks again!
FlyingIsFun1217
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

monkeycracks >> you can allways use raster image editing program like Phothoshop or Gimp as editor and load terrain using heightmap and colormap. ShTlTerrain Scene Node even allowe you to load from seweral files.

FlyingIsFun1217 >> excuse me but I have no experience with Linux so I hope hybrid or somebody else can help you. In general it should be only question of properly linking files toghether.
FlyingIsFun1217
Posts: 219
Joined: Fri Apr 13, 2007 8:29 pm
Location: Illinois
Contact:

Post by FlyingIsFun1217 »

arras wrote: you can allways use raster image editing program like Phothoshop or Gimp as editor and load terrain using heightmap and colormap. ShTlTerrain Scene Node even allowe you to load from several files.
Just for future reference, this means that the tiles are just made of heightmaps?
arras wrote: FlyingIsFun1217 >> excuse me but I have no experience with Linux so I hope hybrid or somebody else can help you. In general it should be only question of properly linking files toghether.
Yes, linking...
Thats my problem. I wish I were more knowledgable on the ways of the g++ compiler :)

Thanks again,
FlyingIsFun1217
gunnicom
Posts: 13
Joined: Tue Apr 24, 2007 9:32 pm

Post by gunnicom »

I did not read the post thread completely, but if its just a matter of linking, did you try to give the compiler the path and the lib it should link to i.e.:

-L/usr/X11R6/lib -L/PATH/TO/YOUR/IRRLICHT/irrlicht-1.3/lib/Linux -lIrrlicht -lGL -lGLU -lXxf86vm -lXext -lX11
FlyingIsFun1217
Posts: 219
Joined: Fri Apr 13, 2007 8:29 pm
Location: Illinois
Contact:

Post by FlyingIsFun1217 »

gunnicom wrote:I did not read the post thread completely, but if its just a matter of linking, did you try to give the compiler the path and the lib it should link to i.e.:

-L/usr/X11R6/lib -L/PATH/TO/YOUR/IRRLICHT/irrlicht-1.3/lib/Linux -lIrrlicht -lGL -lGLU -lXxf86vm -lXext -lX11
Well, I'm using C::B, which is set to search for the lib (.a) in one directory, and the header files in another.

FlyingIsFun1217
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

Just for future reference, this means that the tiles are just made of heightmaps?
No, tiles are made of two polygoons each. Each tile is defined by size, which together with ists relative position determine X and Z coordinates of 4 tile vertices and height which gives Y coordinate. Heightmap is one of the ways howe to define height data of terrain. When writing about possibility of using seweral files I was refering to ability to load heightmap in to defined position. This allowe to split large heightmap in to seweral smaller and load them one by one. The same is valid for colormap.

For example let say terrain is 1003 x 1003 tiles large. You would use heightmap of 1004 x 1004 pixels to load height data to terrain. You can split that in to 4 heightmaps 502 x 502 each then load them at coordinates (0,0) (0,502) (502,0) (502,502).
FlyingIsFun1217
Posts: 219
Joined: Fri Apr 13, 2007 8:29 pm
Location: Illinois
Contact:

Post by FlyingIsFun1217 »

arras wrote:
For example let say terrain is 1003 x 1003 tiles large. You would use heightmap of 1004 x 1004 pixels to load height data to terrain. You can split that in to 4 heightmaps 502 x 502 each then load them at coordinates (0,0) (0,502) (502,0) (502,502).
Is there any benefit of loading 4 images with the same contents as one large one? Or is it mostly a convenience thing?

FlyingIsFun1217 :)
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

ShTlTerrain Scene Node can theoreticaly handle wery large terrains. It have no problem to work with terrains 2000 x 2000 tiles large. I did compile demo with terrain 5000 x 5000 tiles large once but it was pain untill it got initialized of course. Only limit here is size of data arrays hardware can handle. Therefore I felt it is neccessery to allow user to load terrain from seweral smaler files if wished so.

Heightmap loading was one of the features some people liked to have in old TlTerrain Scene Node so I wrote function for it and added function for loading color maps.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Which directories did you configure c::b for? It should be include/ and lib/Linux. However, lib/Linux does not contain the .a file in the SDK, but you have to compile your own. But that's pretty easy. Just change to source/Irrlicht and call 'make'.
FlyingIsFun1217
Posts: 219
Joined: Fri Apr 13, 2007 8:29 pm
Location: Illinois
Contact:

Post by FlyingIsFun1217 »

arras wrote:ShTlTerrain Scene Node can theoreticaly handle wery large terrains. It have no problem to work with terrains 2000 x 2000 tiles large. I did compile demo with terrain 5000 x 5000 tiles large once but it was pain untill it got initialized of course. Only limit here is size of data arrays hardware can handle. Therefore I felt it is neccessery to allow user to load terrain from seweral smaler files if wished so.

Heightmap loading was one of the features some people liked to have in old TlTerrain Scene Node so I wrote function for it and added function for loading color maps.
Ok, that clears it up a bit. And yes, that really is a very useful way of doing things :)
hybrid wrote:Which directories did you configure c::b for? It should be include/ and lib/Linux. However, lib/Linux does not contain the .a file in the SDK, but you have to compile your own. But that's pretty easy. Just change to source/Irrlicht and call 'make'.
Yes, everything has been compiled, all headers are linked to, and the .a file has been linked to. Like I said before, my only problem is that upon trying to compile the main.cpp example provided with the source, I get the error:
main.cpp:(.text+0x158f): undefined reference to `ShTlTerrainSceneNode::ShTlTerrainSceneNode(irr::scene::ISceneManager*, unsigned int, unsigned int, float, unsigned int, irr::scene::ISceneNode*, int)'
Thanks again!
FlyingIsFun1217
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

you have to compile and link the ShTlTerrainSceneNode.o file.
FlyingIsFun1217
Posts: 219
Joined: Fri Apr 13, 2007 8:29 pm
Location: Illinois
Contact:

Post by FlyingIsFun1217 »

hybrid wrote:you have to compile and link the ShTlTerrainSceneNode.o file.
Thats the part I don't know how to do... :oops:
I know now the process involves compiling the source (headers?) into a .o file, and then make a library out of it to link to (.a). But like I said, I've never REALLY been exposed to the g++ compiler (what I use) to know how :(

Thanks!
FlyingIsFun1217
HLFat
Posts: 71
Joined: Sun Sep 24, 2006 6:55 pm
Location: USA

Post by HLFat »

I noticed that with Digital Mars and Borland Turbo Explorer I get an exception when closing the program.

The Dr. Watson log says something about the runtime library.

It goes away when I comment out terrain->drop.

Edit:Not realizing that drop returned a bool, I checked the return value.

It returns a zero.
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

By exepion you mean that program crashes when closing? Are you using your own library or one that is part of demo? What Irrlicht wersion is it?

terrain->drop() return false because object was not deleted yet, only its reference counter was decremented. It would be deleted if drop() was called once more, which I think happens when device is droped.

If you check example num. 03.CustomSceneNode you see that custom node was also droped afther it was created:
Create our scene node. Note that it is dropped (->drop()) instantly after we create it. This is possible because the scene manager now takes care of it. This is not nessecary, it would also be possible to drop it at the end of the program.
HLFat
Posts: 71
Joined: Sun Sep 24, 2006 6:55 pm
Location: USA

Post by HLFat »

By exepion you mean that program crashes when closing?
Yes.
Are you using your own library or one that is part of demo?
I am using your main.cpp from from the demo.
What Irrlicht wersion is it?
1.3.
terrain->drop() return false because object was not deleted yet, only its reference counter was decremented
Let me check the return value on example 03.

Edit: Ok,it's also a return value of zero on example 03.
Post Reply