Page 19 of 23

MCamera.h

Posted: Tue Jul 29, 2008 4:01 pm
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

Posted: Tue Jul 29, 2008 4:24 pm
by JRS
Now I tried this:

Code: Select all

void setTarget(core::vector3df tar)
    {
        camera->setTarget(getPosition() + tar);
    }
but it doesn't work either...
:(

Posted: Tue Jul 29, 2008 4:58 pm
by JRS
Ok,

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

Thanks

Posted: Sat Aug 09, 2008 2:43 pm
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! : )

Posted: Sat Aug 09, 2008 9:26 pm
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.

Posted: Sun Aug 10, 2008 8:56 pm
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?

Posted: Sun Aug 10, 2008 9:19 pm
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?

Posted: Mon Aug 11, 2008 9:24 am
by tdz
I tried the same scene without textures, still the same problem:

Image

Image

Posted: Mon Aug 11, 2008 12:26 pm
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.

problem

Posted: Fri Aug 15, 2008 11:15 pm
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)'

reply

Posted: Thu Oct 16, 2008 9:19 am
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

Posted: Thu Oct 16, 2008 11:12 am
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^^

reply

Posted: Thu Oct 16, 2008 11:24 am
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();

Posted: Thu Oct 16, 2008 12:39 pm
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.

reply

Posted: Thu Oct 16, 2008 12:56 pm
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 :)