moving camera

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.

moving camera

Postby andreee » Sun Jan 22, 2012 12:34 am

Hello, a quick newbie question:

I have an overhead RTS-like camera, want to move it, so i move the camera itself and the cameras target by the same amount,
but still it kind of, well, i think the camera's target doesn't change..

What am i missing?
Dreaming of folk-art at http://www.ambersky.cz
andreee
 
Posts: 39
Joined: Thu Feb 09, 2006 11:13 am
Location: Prague

Re: moving camera

Postby CuteAlien » Sun Jan 22, 2012 12:56 am

Uhm, well - it should obviously work. But no idea what you are missing as I can't see what you are doing - please wait a little while I hack into your system so I can see your sources ;-)
IRC: #irrlicht on irc.freenode.net
My patches&stuff: http://www.michaelzeilfelder.de/irrlicht.htm
Games with Irrlicht: http://www.irrgheist.com/
News: http://www.reddit.com/r/irrlicht/
User avatar
CuteAlien
Admin
 
Posts: 5358
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany

Re: moving camera

Postby andreee » Sun Jan 22, 2012 1:02 am

:)

Well its basically this (its java, but i think what the hell)
cpp Code: Select all
 
switch (key) {
                                case KEY_DOWN:
                                       
                                        target = camera.getTarget();
                                        target.setX(target.getX() + amount);
                                        camera.setTarget(target);
                                                                               
                                        target = camera.getPosition();
                                        target.setX(target.getX() + amount);
                                        camera.setPosition(target);
                                       
                                        break;
                                ..........
 
Dreaming of folk-art at http://www.ambersky.cz
andreee
 
Posts: 39
Joined: Thu Feb 09, 2006 11:13 am
Location: Prague

Re: moving camera

Postby CuteAlien » Sun Jan 22, 2012 1:50 am

Hm, well - I still don't know how your RTS-cam looks like. You should always do an updateAbsolutePosition between setting the position and the target (it's important for some camera-types).
IRC: #irrlicht on irc.freenode.net
My patches&stuff: http://www.michaelzeilfelder.de/irrlicht.htm
Games with Irrlicht: http://www.irrgheist.com/
News: http://www.reddit.com/r/irrlicht/
User avatar
CuteAlien
Admin
 
Posts: 5358
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany


Return to Beginners Help

Who is online

Users browsing this forum: etcaptor, Google [Bot] and 1 guest