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.
Post Reply
andreee
Posts: 43
Joined: Thu Feb 09, 2006 11:13 am
Location: Prague

moving camera

Post by andreee »

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
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: moving camera

Post by CuteAlien »

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.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
andreee
Posts: 43
Joined: Thu Feb 09, 2006 11:13 am
Location: Prague

Re: moving camera

Post by andreee »

:)

Well its basically this (its java, but i think what the hell)

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
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: moving camera

Post by CuteAlien »

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.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