How to make the camera look at point in 3d space?

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
MessiaH
Posts: 55
Joined: Tue Jul 06, 2004 6:37 pm
Location: RUSSIA

How to make the camera look at point in 3d space?

Post by MessiaH »

This is a really stupid question,but how can I do it?
When I write
camera->setTarget(core::vector3d(10,10,10));
or something like that,the effect is not that I had expected!
StelK
Posts: 2
Joined: Tue Jan 04, 2005 11:16 am

Post by StelK »

hi
with this code the camera looks to 0,5,0
smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));
it should works bye bye
MessiaH
Posts: 55
Joined: Tue Jul 06, 2004 6:37 pm
Location: RUSSIA

Post by MessiaH »

No,I need this action to be done in dynamic way!
We got a point in 3d space-we make the camera to face it.
Another point-the same camera-the same action...
How this can be done?
Code please!!! :cry:
digfarenough
Posts: 39
Joined: Sat Oct 30, 2004 4:35 pm
Location: Boston, MA
Contact:

Post by digfarenough »

what is the result you expect and what is the actual result?

camera->setTarget(core::vector3d(10,10,10)) should leave the camera in the same position but suddenly change it's direction so the point (10,10,10) is right in the middle of the camera's view
MessiaH
Posts: 55
Joined: Tue Jul 06, 2004 6:37 pm
Location: RUSSIA

Post by MessiaH »

Have you tested this function?
I expected the same,but in reality it doesn't work so!
digfarenough
Posts: 39
Joined: Sat Oct 30, 2004 4:35 pm
Location: Boston, MA
Contact:

Post by digfarenough »

I have tested it and it works fine for me with a normal camera scene node (I haven't tried it with an FPS or Maya camera)

are you sure that the point (10,10,10) is the right point? for instance, try adding a test scene node and putting it at that position, then seeing if camera->setTarget points the camera to it or not
Post Reply