Re: [osg-users] Add a new child
I solved the problem with the following code: Code: osg::Vec3 achse(0.0, 0.0, 0.0); osg::Matrixd myRotationMatrix; //myRotationMatrix.makeRotate(osg::DegreesToRadians(2.0f), achse); myRotationMatrix.makeTranslate(0.0,20.0,0.0); viewer.getCameraManipulator()-setByMatrix(viewer.getCameraManipulator()-getMatrix() * myRotationMatrix); thanks anyway -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=32210#32210 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Add a new child
Ulrich Hertlein wrote: On 28/09/10 18:45 , Cosimo Luigi Manes wrote: osgGA::CameraManipulator (the base class for the default manipulators) has a 'home()' method than will recompute the position if 'setAutoComputeHomePosition' is true. Thanks you for your answer. Could you post an example of code because i am a newbie. Also, if i want to run a rotation or translation or zoom, what should i do ? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=32168#32168 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Add a new child
On 29/09/10 19:27 , Cosimo Luigi Manes wrote: Ulrich Hertlein wrote: On 28/09/10 18:45 , Cosimo Luigi Manes wrote: osgGA::CameraManipulator (the base class for the default manipulators) has a 'home()' method than will recompute the position if 'setAutoComputeHomePosition' is true. Thanks you for your answer. Could you post an example of code because i am a newbie. viewer.getCameraManipulator()-home(); Also, if i want to run a rotation or translation or zoom, what should i do ? I'd recommend you read the OSG QuickStartGuide, it covers this and many other aspects of OSG. Basically what you need to do it modify the camera matrix to obtain rotation/translation and modify the field-of-view to zoom. Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Add a new child
Ulrich Hertlein wrote: I'd recommend you read the OSG QuickStartGuide, it covers this and many other aspects of OSG. Basically what you need to do it modify the camera matrix to obtain rotation/translation and modify the field-of-view to zoom. thanks for the reply. I have already read QuickStartGuide OSG, but it isn't thorough. Can you post an example of code to execute for the operation of zoom, rotate and translation ? Where i can find other examples ? thanks again -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=32196#32196 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Add a new child
On Mon, Sep 27, 2010 at 9:36 PM, Cosimo Luigi Manes man...@cheapnet.it wrote: the problem is that i load new nodes when the sg running Could it be that your camera isn't being updated to look at your new models? Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Add a new child
On 28/09/10 17:19 , Robert Osfield wrote: On Mon, Sep 27, 2010 at 9:36 PM, Cosimo Luigi Manes man...@cheapnet.it wrote: the problem is that i load new nodes when the sg running Could it be that your camera isn't being updated to look at your new models? I believe what Robert is referring to is this: that the camera will initially compute a position that shows the entire scene graph *at that time* (based on the current scene bounding sphere). This position won't be updated afterwards so if you add nodes they might not be in view. What happens when you press 'space' to reset the camera position? Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Add a new child
Ulrich Hertlein wrote: On 28/09/10 17:19 , Robert Osfield wrote: What happens when you press 'space' to reset the camera position? Well, when i press 'space', software shows the nodes. How can i reset the camera position ? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=32122#32122 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Add a new child
On 28/09/10 18:45 , Cosimo Luigi Manes wrote: Ulrich Hertlein wrote: On 28/09/10 17:19 , Robert Osfield wrote: What happens when you press 'space' to reset the camera position? Well, when i press 'space', software shows the nodes. How can i reset the camera position ? osgGA::CameraManipulator (the base class for the default manipulators) has a 'home()' method than will recompute the position if 'setAutoComputeHomePosition' is true. /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Add a new child
the problem is that i load new nodes when the sg running -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=32113#32113 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org