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
JRS
Posts: 45
Joined: Tue Jun 03, 2008 10:00 am
Location: Universität Heidelberg

MCamera.h

Post by JRS »

Hey,

how is it possible to setTarget for MCameraFPS?
I tried to modify MCamera.h like this:

Code: Select all

void setPosition(core::vector3df pos)
    {
        camera->setPosition(pos);
        camera->setTarget(pos + core::vector3df(0,0,-1));
        camera->updateAbsolutePosition();
    }
and I tried to modify the direction vector right at the beginning but this does also not work.

I don't want to change the movement itself so there isn't much remaining to do.

Has anybody an idea?

Thank you.
Regards,
jan
JRS
Posts: 45
Joined: Tue Jun 03, 2008 10:00 am
Location: Universität Heidelberg

Post by JRS »

Now I tried this:

Code: Select all

void setTarget(core::vector3df tar)
    {
        camera->setTarget(getPosition() + tar);
    }
but it doesn't work either...
:(
JRS
Posts: 45
Joined: Tue Jun 03, 2008 10:00 am
Location: Universität Heidelberg

Post by JRS »

Ok,

I did it... I just set Y-Rotation to 180.0f...
This worked for me ;)

Thanks
tdz
Posts: 3
Joined: Sat Aug 09, 2008 2:36 pm

Post by tdz »

Hi!

I've just played around with this terrain stuff and it's absolutely perfect for my current project!

However, I got some problems connecting more than one terrain nodes together. I already managed to get the edges glued together, but there's a dark line remaining after altering the heights (using setHeight()). I'm guessing it has something to do with the light mapping, but please see for yourself:

Image
Image

Is there any chance to get rid of that? I didn't try very hard yet, because I'm not very experienced in using Irrlicht, but the few attempts i made so far didn't help me welding the gaps.

Thank's in advance! : )
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Could be a mipmap or texture clamp problem. Do you use OpenGL? Try the D3D or software renderer for a test, if that solves it the texture clamp bug I just removed a few days ago might happen here.
tdz
Posts: 3
Joined: Sat Aug 09, 2008 2:36 pm

Post by tdz »

After EDT_SOFTWARE crashes for some reason when using ShTlterrainSceneNode and DX isn't included in the SDK GCC-Version of the dll I just tried with EDT_BURNINGSVIDEO. This didn't change anything so far, still dark edges on the terrain borders, even with lighting disabled :(

Any ideas?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

It looks like the terrain node uses clamp_to_edge for only the first texture. So if you're using more than one texture, you might want to change the clamp mode of it as well. How do your textures look like?
tdz
Posts: 3
Joined: Sat Aug 09, 2008 2:36 pm

Post by tdz »

I tried the same scene without textures, still the same problem:

Image

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

Post by arras »

It might be problem with texture clamp on generated texture ...that is texture which is set in to first layer of material. That texture is depending on dimensions of your terrain (vissible part) larger than needed so part of it is not displayed. Those pixels are black and get blend in to those which are displayed on the border of terrain. You can solve it by trying different clamping method ...you can set it in constructor.
Or choosing size of visible terrain such that generated texture for it is exactly power of two in size. One pixel is set per one terrain point not per tile I think so you may need to set vissible terrain size one tile smaller that texture. 127x127 for example to get texture 128x128 tiles. I am not sure about that anymore however, its some time since I was coding it so you may try both sizes ...128 and 127 for example for vissible terrain. Absolute size of terrain have no influence on this.

Aslo note that there is always at last one texture present even if you would not set any since it is internally generated by node.

And still another thing ...you have to manually set normals at points where terrains meet since those terrains know nothing about each other.
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

problem

Post by 3DModelerMan »

How come when I use this

Code: Select all

// create terrain scene node
ShTlTerrainSceneNode* terrain = new ShTlTerrainSceneNode(smgr, 2000, 2000, 1, 100);
terrain->drop();
my app crashes with an error

Code: Select all

C:/Documents and Settings/Tanner/My Documents/Wolfpack/Wolfpack/main.cpp:92: undefined reference to `ShTlTerrainSceneNode::ShTlTerrainSceneNode(irr::scene::ISceneManager*, int, int, float, int, irr::scene::ISceneNode*, int)'
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
m3ltd0wn
Posts: 107
Joined: Wed Dec 12, 2007 8:32 am
Location: Romania

reply

Post by m3ltd0wn »

i've seen somwhere in this topic a post about triangle selector for this tiled terrain scene node, but the link doesn't work, can somebody help me with some info about this ?? i really need to add wowlike camera and it needs the triangle selector :)

10x
Darktib
Posts: 167
Joined: Sun Mar 23, 2008 8:25 pm
Location: France

Post by Darktib »

Why a camera need a triangle selector ? You want to move your camera using the mouse?

You just have to retrieve the coordinates of the click using picking commands (first example : in the demo...) and move your camera at this position (but at a certain height).

First thing to do : take a note pad, a pencil, and search... Math are your friend^^
m3ltd0wn
Posts: 107
Joined: Wed Dec 12, 2007 8:32 am
Location: Romania

reply

Post by m3ltd0wn »

this is my camera, it's a 3rd person camera, and i have it form the irrlicht forums :)

if i don't use a selector the character will fall through the terrain, also i can't apply newton to this terrain..so i need a triangle selector to make my collisions

Code: Select all

irr::scene::CCameraRPGSceneNode* camera = new irr::scene::CCameraRPGSceneNode(actor, smgr, 1, device, selector); 
	camera->configure("cam.xml");
	smgr->setActiveCamera(camera);
    camera->drop();
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

On a heightmap, a physic collision is always slower than just interpolating the 4 closest corners based on your location and use that as your ground. If you have other objects using a physic engines, then you can think about it. But then again, most good physic library support a heightmap feed.
m3ltd0wn
Posts: 107
Joined: Wed Dec 12, 2007 8:32 am
Location: Romania

reply

Post by m3ltd0wn »

well as physics engine i use IrrNewt and Newton, and if i try to create the terrain body with newton (i'm using 2048x2048 height map and 2048x2048 texture for the terrain, generated by L3DT) at some point of loading the application just crashes :)
Post Reply