problem with setTarget...silly

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
flyingsaucer

problem with setTarget...silly

Post by flyingsaucer »

hy...i am not so trained with irrlicht...but i have a strange problem...

i am not able to set 0 as a value for the vetor3df ....i want to set setTarget() to the point 80, 20, 0 ...but with setting 0 for z it keeps the original target..with 0.001 for z it works...not with 0...what am i doing wrong??

please... ^_^
Luke923
Posts: 59
Joined: Wed Nov 05, 2003 5:26 am

Post by Luke923 »

How are you doing this? Have you tried

Code: Select all

setTarget(core::vector3df(80.0f,20.0f,0.0f);
It shouldn't matter, but vector3df, if I remember right, is a class that, for all intents and purposes, is nothing more than 3 floats. Give that a try. Otherwise, please post an example of how you're specifying the target.
"Object-oriented programming is an exceptionally bad idea which could only have originated in California."
- E.W. Dijkstra
flyingsaucer

Post by flyingsaucer »

does not work ...camera looks only in z - direction


camera = smgr->addCameraSceneNodeFPS(0, 100.0f,500.0f, -1, keyMap, 8);

scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
selector, camera, core::vector3df(30,50,30),
core::vector3df(0,-100,0), 100.0f,
core::vector3df(0,50,0));



//camera->addAnimator(anim);
camera->setTarget(core::vector3df(-150.0f,20.0f,0.0f));
camera->setPosition(core::vector3df(-40,20,0));
camera->updateAbsolutePosition();



i think a great value for z is used...because the camera looks in the z - direction ....have no clue why.. :(
Luke923
Posts: 59
Joined: Wed Nov 05, 2003 5:26 am

Post by Luke923 »

You sure you're not locked on the X Axis? Because, according to your code:

Code: Select all

camera->setTarget(core::vector3df(-150.0f,20.0f,0.0f)); 
camera->setPosition(core::vector3df(-40,20,0)); 
camera->updateAbsolutePosition(); 

Code: Select all


you're staring down the X Axis.  If your camera is truly looking straight up or straight down, it sounds like a divide by zero issue inside Irrlicht.  That would require the expertise of Niko or someone more versed with the inner workings of the engine than I.
"Object-oriented programming is an exceptionally bad idea which could only have originated in California."
- E.W. Dijkstra
Guest

Post by Guest »

another crazy thing is that even if i change the direction of the x - value ... 150 instead of -150 the look at does not change ...
flyingsacer

Post by flyingsacer »

another crazy thing is that even if i change the direction of the x - value ... 150 instead of -150 the look at does not change ...
Serg Nechaeff
Posts: 162
Joined: Wed Nov 26, 2003 5:24 pm
Location: Europe

Post by Serg Nechaeff »

i guess it is normal because this is the fps camera which depends on your mouse device, change your camera into a normal one and go from there.
http://www.javazing.com
P-III-950, WinXP, GeForce FX5600 128 MB ForceWare 52.16, DX9, Eclipse IDE, JRE 1.6
Post Reply