Re: [osg-users] Camera control and view matrix
Hi, Robert. You've said: As for examples of manage the view matrix, there should be examples in the archives, but in the end it all boils down to not using a CameraManipulator and instead calling on each frame: viewer.getCamera()-setViewMatrix(viewMatrix); How do I stop using the default camera manipulator, that I believe is TrackballManipulator? Thanks. Renan M Z Mendes ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Camera control and view matrix
I believe it's just a simple matter of commenting the manipulator out where you call viewer-setCameraManipulator(). That's what I do when I want explicit control of the camera via my own view matrix... -Shayne -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Renan Mendes Sent: Thursday, September 18, 2008 11:39 AM To: OpenSceneGraph Users Subject: Re: [osg-users] Camera control and view matrix Hi, Robert. You've said: As for examples of manage the view matrix, there should be examples in the archives, but in the end it all boils down to not using a CameraManipulator and instead calling on each frame: viewer.getCamera()-setViewMatrix(viewMatrix); How do I stop using the default camera manipulator, that I believe is TrackballManipulator? Thanks. Renan M Z Mendes smime.p7s Description: S/MIME cryptographic signature ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Camera control and view matrix
Hi Renan, The osgViewer::Viewer by default doesn't have any camera manipulators attached, but... if you call run without attaching a camera manipultor then it'll add a TrackballManipulator as a fallback to make the view usable. If you are controlling the view matrix from your own frame loop then you won't be calling run() so you won't have any CamerManipulator attached unless you go add one yourself. Robert. On Thu, Sep 18, 2008 at 6:39 PM, Renan Mendes [EMAIL PROTECTED] wrote: Hi, Robert. You've said: As for examples of manage the view matrix, there should be examples in the archives, but in the end it all boils down to not using a CameraManipulator and instead calling on each frame: viewer.getCamera()-setViewMatrix(viewMatrix); How do I stop using the default camera manipulator, that I believe is TrackballManipulator? Thanks. Renan M Z Mendes ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Camera control and view matrix
Hi Renan, Thanks for the link, I'll update it tomorrow, unless some kindly soul gets to it before me :-) Robert. On Thu, Sep 18, 2008 at 5:36 PM, Renan Mendes [EMAIL PROTECTED] wrote: Robert, The page I'm talking about that still references osg::Producer is http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/CameraControl. Basically, all pages related to camera control tutorials. It even has a wiki editing note about this. Renan M Z Mendes ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Camera control and view matrix
Grepping the osgViewer source for TrackballManipulator should reveal that you only get one by default if you call Viewer::run(). Don't call that, instead call Viewer::done() and Viewer::frame(). Then you won't get a default camera manipulator. -Paul _ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Renan Mendes Sent: Thursday, September 18, 2008 11:39 AM To: OpenSceneGraph Users Subject: Re: [osg-users] Camera control and view matrix Hi, Robert. You've said: As for examples of manage the view matrix, there should be examples in the archives, but in the end it all boils down to not using a CameraManipulator and instead calling on each frame: viewer.getCamera()-setViewMatrix(viewMatrix); How do I stop using the default camera manipulator, that I believe is TrackballManipulator? Thanks. Renan M Z Mendes ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Camera control and view matrix
Search the mailing lists, there are lots of references to this in previous posts.. some of the examples also exercise these things Paul and Bobs user guides Gordon __ Gordon Tomlinson Product Manager 3D Email : gtomlinson @ overwatch.textron.com __ (C): (+1) 571-265-2612 (W): (+1) 703-437-7651 Self defence is not a function of learning tricks but is a function of how quickly and intensely one can arouse one's instinct for survival - Master Tambo Tetsura From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Renan Mendes Sent: Wednesday, September 17, 2008 10:31 AM To: OSG Mailing List Subject: [osg-users] Camera control and view matrix Hi, I need some references on camera control and view matrices. The tutorial in OSG's website is outdated, for it still makes use of osg::Producer. Can anyone send me a few suggestions? Thanks, Renan M Z Mendes ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Camera control and view matrix
Here's what I do using euler angles (_camAng) and position (_camPos). osg::Quat quat(_camAng[0],osg::X_AXIS,_camAng[1],osg::Y_AXIS,_camAng [2],osg::Z_AXIS); osg::Matrix viewMat = osg::Matrix::rotate(quat) * osg::Matrix::translate (_camPos); viewMat.preMult(osg::Matrix::rotate(osg::PI_2,osg::X_AXIS)); viewMat.invert(viewMat); _camera-setViewMatrix(viewMat); Brian [EMAIL PROTECTED] wrote: - To: OSG Mailing List osg-users@lists.openscenegraph.org From: Renan Mendes [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] Date: 09/17/2008 10:30AM Subject: [osg-users] Camera control and view matrix Hi, I need some references on camera control and view matrices. The tutorial in OSG's website is outdated, for it still makes use of osg::Producer. Can anyone send me a few suggestions? Thanks, Renan M Z Mendes ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Camera control and view matrix
Hi Renan, On Wed, Sep 17, 2008 at 3:30 PM, Renan Mendes [EMAIL PROTECTED] wrote: I need some references on camera control and view matrices. The tutorial in OSG's website is outdated, for it still makes use of osg::Producer. Can anyone send me a few suggestions? Which pages in particular still reference Producer? Most should have been ported across. As for examples of manage the view matrix, there should be examples in the archives, but in the end it all boils down to not using a CameraManipuilator and instead calling on each frame: viewer.getCamera()-setViewMatrix(viewMatrix); Or just writing your own CameraManipulator, as per src/osgGA/TrackballManipulator.cpp etc. I think that OpenSceneGraph Quick Start Guide might briefly cover this topic to so grab a download of the book and read through it. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Camera control and view matrix
Quats use radians so you need to go from degrees to radians See http://www.vis-sim.com/osg/osg_faq_1.htm#f16 I have posted other links to this topic in the past so a search of the archives should pop them up Gordon __ Gordon Tomlinson Product Manager 3D Email : gtomlinson @ overwatch.textron.com __ (C): (+1) 571-265-2612 (W): (+1) 703-437-7651 Self defence is not a function of learning tricks but is a function of how quickly and intensely one can arouse one's instinct for survival - Master Tambo Tetsura -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian R Hill Sent: Wednesday, September 17, 2008 10:55 AM To: OpenSceneGraph Users Subject: Re: [osg-users] Camera control and view matrix Here's what I do using euler angles (_camAng) and position (_camPos). osg::Quat quat(_camAng[0],osg::X_AXIS,_camAng[1],osg::Y_AXIS,_camAng [2],osg::Z_AXIS); osg::Matrix viewMat = osg::Matrix::rotate(quat) * osg::Matrix::translate (_camPos); viewMat.preMult(osg::Matrix::rotate(osg::PI_2,osg::X_AXIS)); viewMat.invert(viewMat); _camera-setViewMatrix(viewMat); Brian [EMAIL PROTECTED] wrote: - To: OSG Mailing List osg-users@lists.openscenegraph.org From: Renan Mendes [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] Date: 09/17/2008 10:30AM Subject: [osg-users] Camera control and view matrix Hi, I need some references on camera control and view matrices. The tutorial in OSG's website is outdated, for it still makes use of osg::Producer. Can anyone send me a few suggestions? Thanks, Renan M Z Mendes ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Camera control and view matrix
Or just writing your own CameraManipulator, as per src/osgGA/TrackballManipulator.cpp etc. Yes, the TrackballManipulator code is a good reference for this stuff. The original post is pretty vague; perhaps the original poster would benefit from some basic OpenGL information regarding the ModelView matrix, as found in the OpenGL red book. -Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org