Camera Up Vector

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
metalseb
Posts: 15
Joined: Tue Mar 01, 2005 8:50 am
Location: Lille - France
Contact:

Camera Up Vector

Post by metalseb »

Hi folks. Brand new here. A bit noob about 3d rendering too.

Well, I struggle against Irrlicht engine since a few days and the things are getting clearer. But there is some things that I cannot understand at the oment and I cannot find any help on the forum.

Well, sometimes camera deals with its "up vector" and I don't see at all what it means.

Anyone could help ?

Thx !
Guest

Post by Guest »

Up vector is camera top direction.

Code: Select all

                        .  up vector (0,1,0) 
                      . . .
                        .
                        .
                        y                       
                ................                 
                .               .
           -x   .               .  x                normal camera 
                .               .
                .................

                      -y




                                                    
                                                  camera turned right

                       y
                ................
                .               .            .
           -x   .               .  x  .  .  . .    up vector (1,0,0).
                .               .            .
                .................

                      -y
mohaps
Posts: 248
Joined: Tue Jun 08, 2004 1:54 pm
Location: Shrewsbury MA
Contact:

Post by mohaps »

think of it this way

a camera in space can be defined by,

a) where it is located (position)
b) where it is pointing (target)
c) which direction is upwards for the camera (up)

now in most cases the up vector is (0,1,0) in FPS games and RPGs etc. since you are always walking on the ground... but in some 6 DOF games like Descent or Other Flight Sims it is possible to rotate the camera arbitraily hence.. the up vector becomes helpful in .. well .. finding which is the up direction for the camera...
---
Saurav Mohapatra
author, artist and bona fide geek

web: http://www.mohaps.com
email: mohaps AT gmail DOT com
metalseb
Posts: 15
Joined: Tue Mar 01, 2005 8:50 am
Location: Lille - France
Contact:

Post by metalseb »

Thanks a lot for this.

Now I'm messing up a bit with the target vector. Whatever I enter in setTarget method of my camera scene node, the camera always looks down to the ground and I always get [0,0,100] as target vector with getTarget method.

For example, I have a testnode on which I apply a flystraight animator and I want the camera to follow up this testnode using setTarget but I cannot see how to achieve that since all I can do with setTarget is messing up the display as described above.

Thx again for your precious help folks ! :D
Guest

Post by Guest »

Up !

After some experiments, it seems that I fail to setTarget on anything using a FPS-type Camera. If I use a "standard" ICameraSceneNode, I can target on something, but I have to handle by myself all camera movements. Damn ! :evil:

I'm really stuck with this, anybody could tell me why I have such difficulties to targer on something using FPS camera node ? :cry:

Thx !
hungryninja
Posts: 26
Joined: Wed Jan 26, 2011 12:13 am

Re: Camera Up Vector

Post by hungryninja »

Why doesn't the camera like using a rotation instead of a target?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Camera Up Vector

Post by CuteAlien »

Please check ICameraSceneNode::bindTargetAndRotation http://irrlicht.sourceforge.net/docu/cl ... 5ac54e7205
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hungryninja
Posts: 26
Joined: Wed Jan 26, 2011 12:13 am

Re: Camera Up Vector

Post by hungryninja »

does it bind upvector?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Camera Up Vector

Post by CuteAlien »

No, it binds target and rotation. The upvector is independent of that.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply