[osg-users] Rotate Camera on Its Axis

2015-06-17 Thread Rômulo Cerqueira
Hi, I have problems with this topic. I get my View Matrix by viewer-getCamera()-getViewMatrix() and apply a rotation by preMult, but the camera rotates using the center of the world scene as reference, not its own center. How I can do this? ... Thank you! Cheers, Rômulo --

Re: [osg-users] Rotate camera around the scene in osgViewer - simple way?

2010-09-23 Thread Werner Modenbach
Hi Dženan, I don't know if it is still of interest for you. If not, maybe someone else can profit. Here is my solution for turning the camera arround the scene: osg::Vec3 achse; osg::Matrix rotation_matrix(view-trackball-getRotation()); if (orientation == Horizontal) {

Re: [osg-users] Rotate camera around the scene in osgViewer - simple way?

2010-08-31 Thread Dženan Zukić
Hi, Thanks for suggestion. I played with it a bit, but with no success. Anyway, I have debugged the code this procedure was supposed to test, so no need to spend more time on it. Cheers, Dženan -- Read this topic online here:

Re: [osg-users] Rotate camera around the scene in osgViewer - simple way?

2010-08-30 Thread Dženan Zukić
Hi, Thanks for sharing, but I did not modify the frame loop of the viewer, and the following code in Qt on-click event handler does not produce rotation: Code: mainForm.vis-setSceneData(my_object); osg::Vec3 achse(0.1, 0.2, 0.974); osg::Matrixd myRotationMatrix;

Re: [osg-users] Rotate camera around the scene in osgViewer - simple way?

2010-08-30 Thread Werner Modenbach
Hi Dženan, my issue is to rotate the scene by wheels under and beside the window. Unfortunately this is very essential for my application and I didn't manage it so far. But turning (somehow) in general works here. My solution has 2 differences to what you wrote: 1) I don't set the scene in the

Re: [osg-users] Rotate camera around the scene in osgViewer - simple way?

2010-08-30 Thread Dženan Zukić
Hi, I can tell you immediately that I gave up on this :D Cheers, Dženan -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31152#31152 ___ osg-users mailing list osg-users@lists.openscenegraph.org

Re: [osg-users] Rotate camera around the scene in osgViewer - simple way?

2010-08-30 Thread Ulrich Hertlein
Hi Dženan, On 30/08/10 20:35 , Dženan Zuki wrote: mainForm.vis-setSceneData(my_object); osg::Vec3 achse(0.1, 0.2, 0.974); osg::Matrixd myRotationMatrix; myRotationMatrix.makeRotate(osg::DegreesToRadians(2.0f), achse);

Re: [osg-users] Rotate camera around the scene in osgViewer - simple way?

2010-08-28 Thread Werner Modenbach
Hi Dženan, Actually I have the same intention as you. My approach was like that: osg::Vec3 achse; if (orientation == Qt::Horizontal) { achse = osg::Vec3(0.0, 0.0, 1.0); } else { achse = osg::Vec3(1.0, 0.0, 0.0); } osg::Matrixd myRotationMatrix;

[osg-users] Rotate camera around the scene in osgViewer - simple way?

2010-08-27 Thread Dženan Zukić
Hi, Is there a simple way to programmatically set rotation of a model in osgViewer? [code]myViewer-setSceneData(fancyObject); myViewer-run();[/code] After this code, the object is displayed statically in the window. To get it to rotate, the user must click and pull the object in the desired

Re: [osg-users] Rotate camera around the scene in osgViewer - simple way?

2010-08-27 Thread Tom Pearce
Something quick and easy would be to calculate a new position for your camera on each frame and set the view matrix as part of a frame() loop. while(!myViewer-done()) { myViewer-getCamera()-setViewMatrix(whatever it should be this frame); myViewer-frame(); } Cheers, Tom -- Read

Re: [osg-users] Rotate camera around the scene in osgViewer - simple way?

2010-08-27 Thread Dženan Zukić
Hi, Well I was sort of hoping I could get away without constructing camera matrix, as it involves a bit of computation. If there is no quick and easy way to do it, I will just have to skip it (it is not that important for my project, as it is for debugging purposes). Thank you! Cheers,

Re: [osg-users] Rotate camera

2009-08-31 Thread Alex Malhao
Thanks for your reply! Now that I have a code that will allow me to move how can I use it inside the osgviewer.cpp? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16878#16878 ___ osg-users mailing

[osg-users] Rotate camera

2009-08-28 Thread Alex Malhao
Hi, I am trying to move the camera using the osgviewer. The user robertosfield already gave me the tipo to change the CameraManipulator, but I am still trying to figure out how to do that, is there any tutorial or example that I can see to help me? Where (among the source files) can I find

Re: [osg-users] Rotate camera

2009-08-28 Thread Tomlinson, Gordon
Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Alex Malhao Sent: Friday, August 28, 2009 10:28 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] Rotate camera Hi, I am trying to move the camera using

Re: [osg-users] Rotate camera

2009-08-28 Thread Ümit Uzun
, 2009 10:28 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] Rotate camera Hi, I am trying to move the camera using the osgviewer. The user robertosfield already gave me the tipo to change the CameraManipulator, but I am still trying to figure out how to do that, is there any