Why is my FPS camera a little strange?

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
rainto96
Posts: 7
Joined: Thu Dec 04, 2014 5:06 pm

Why is my FPS camera a little strange?

Post by rainto96 »

When I move my mouse , the all picture rotates strangely.The camera rotation method doesnot like the Counter-Striker game.
My irrlicht version is 1.7 running on Ubuntu14 with Qt.
rainto96
Posts: 7
Joined: Thu Dec 04, 2014 5:06 pm

Re: Why is my FPS camera a little strange?

Post by rainto96 »

It looks like all the picture rotates around the center of the screen.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Why is my FPS camera a little strange?

Post by CuteAlien »

Sorry, as long as we don't know what exactly you have coded we can't help much. Also problem description is a little confusing - maybe you can do quick video-recording?
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
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Why is my FPS camera a little strange?

Post by mongoose7 »

Maybe set the "target"? Shouldn't be the same as "position". May not be needed but could also set the "up" vector.
rainto96
Posts: 7
Joined: Thu Dec 04, 2014 5:06 pm

Re: Why is my FPS camera a little strange?

Post by rainto96 »

I think in common situation , if you move your mouse to left direction , you will look the left side , but on my screen , the scene rotates around the center of the screen.
I use codes follows to create a fps camera.

ICameraSceneNode* fps_camera = smgr->addCameraSceneNodeFPS();

My irrlicht version is 1.7 running on Ubuntu14 with Qt.
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Why is my FPS camera a little strange?

Post by mongoose7 »

You need to set the position and target. For example,

Code: Select all

        fps_camera->setTarget(core::vector3df(0, 90, 0));
        fps_camera->setPosition(core::vector3df(-300, 90, 0));
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Why is my FPS camera a little strange?

Post by CuteAlien »

Target is probably not necessary for fps-camera.
But I have no experience in mixing with Qt, so I don't have any examples for that yet unfortunately.
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
rainto96
Posts: 7
Joined: Thu Dec 04, 2014 5:06 pm

Re: Why is my FPS camera a little strange?

Post by rainto96 »

Any cpp files using the fps camera is ok,thx.
Am i wrongly using the fpscamera ? I only write the ICameraSceneNode* fps_camera = smgr->addCameraSceneNodeFPS();
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Why is my FPS camera a little strange?

Post by CuteAlien »

Try setting a position as mentioned above - does that change anything?
Otherwise it's probably the combination with Qt, but I don't know how you do 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
rainto96
Posts: 7
Joined: Thu Dec 04, 2014 5:06 pm

Re: Why is my FPS camera a little strange?

Post by rainto96 »

OhOhOhOh!!!Maybe because the Operating system.
Without QT,I just open the the example2 in /irrlicht/bin/Linux is the same on Ubuntu14 . But when I run the example2 in /irrlicht/bin/win64/ on windows all the move of the mouse is well!
Why?Does the Ubuntu mouse event handling go wrong ? But Irrlicht supports Linux , I am confused.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Why is my FPS camera a little strange?

Post by CuteAlien »

I just tried 1.7 on Ubuntu 14.04 and can't reproduce it. But I compiled Irrlicht myself, maybe official packages do something different (we do not release those - and I have no idea who does...). You could try using a current Irrlicht version instead (from zip on the homepage or from svn), maybe that works.
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
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Why is my FPS camera a little strange?

Post by mongoose7 »

I think it is how the mouse coords are reported. They should be relative to the window but in this case they are probably reported relative to the screen. I remember having this problem with VirtualBox some time ago.
Post Reply