Re: [osg-users] [3rdparty] How to change camera's yaw and pitch, and move front, back and sideways according to that?
Hi Sam, I managed to implement my own manipulator (OVNIController, derived from FirstPersonManipulator), but still can't change the camera position (I want to change it in the beginning of the program, and also when the user press the Home key). You can see my code here: https://github.com/eco-info/osgCookbook/blob/master/outros/terreno1/terreno1.cpp Best, Rodrigo. On Thursday, January 31, 2019 at 12:58:17 PM UTC-2, Sam Brkopac wrote: > > Hi Rodrigo, > > The Camera::setViewMatrixLookAt function is equivalent to the gluLookAt. > You can find more documentation on the inner workings here ( > https://stackoverflow.com/questions/21830340/understanding-glmlookat). > > If you don't set a camera manipulator prior to viewer.run() and move the > camera the results will be lost due to viewer.run() setting up its own > manipulator and overriding your initial setup. You have a few options: > assign the camera manipulator -> update the manipulator -> call home(1) to > force an update. Don't call viewer.run() and implement the loop yourself > (this will prevent a manipulator from getting set and allowing you to > freely manually manipulate the camera). Implement your own manipulator and > set it before you call viewer.run(). > > If you have a specific question regarding one of the manipulators, please > ask. > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=75575#75575 > > > > > > ___ > osg-users mailing list > osg-...@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > -- You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/a2bcda58-f475-43a9-936d-343fa281e60a%40googlegroups.com. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [3rdparty] How to change camera's yaw and pitch, and move front, back and sideways according to that?
Hi Rodrigo, The Camera::setViewMatrixLookAt function is equivalent to the gluLookAt. You can find more documentation on the inner workings here (https://stackoverflow.com/questions/21830340/understanding-glmlookat). If you don't set a camera manipulator prior to viewer.run() and move the camera the results will be lost due to viewer.run() setting up its own manipulator and overriding your initial setup. You have a few options: assign the camera manipulator -> update the manipulator -> call home(1) to force an update. Don't call viewer.run() and implement the loop yourself (this will prevent a manipulator from getting set and allowing you to freely manually manipulate the camera). Implement your own manipulator and set it before you call viewer.run(). If you have a specific question regarding one of the manipulators, please ask. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75575#75575 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [3rdparty] How to change camera's yaw and pitch, and move front, back and sideways according to that?
Dear Trajce, do you have any idea how incomplete is your answer? There's no point in knowing the function if I don't know how to set its parameters correctly. What everybody learning OSG need is "a simple source code showing how it's done", and this means a few lines of code, not less than a single line. Please. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75574#75574 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [3rdparty] How to change camera's yaw and pitch, and move front, back and sideways according to that?
Hi, viewer.getCamera()->setViewMatrixAsLookAt On Thu, Jan 31, 2019 at 10:01 AM Rodrigo Dias wrote: > I want to change the camera direction with the mouse, and position with > the keyboard. I've found an example on how to change the position, but > still couldn't find anything explaining how to change the direction (and > not sure if the position will change correctly when the direction changes). > All I find is "take a look at the manipulator source code, it will give > inspiration" etc. But I just don't get how can I implement that from the > source code I saw. > > Considering this is such a trivial task, why is it virtually impossible to > find a simple source code showing how it's done? > > Thanks, > Rodrigo > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=75567#75567 > > > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [3rdparty] How to change camera's yaw and pitch, and move front, back and sideways according to that?
I want to change the camera direction with the mouse, and position with the keyboard. I've found an example on how to change the position, but still couldn't find anything explaining how to change the direction (and not sure if the position will change correctly when the direction changes). All I find is "take a look at the manipulator source code, it will give inspiration" etc. But I just don't get how can I implement that from the source code I saw. Considering this is such a trivial task, why is it virtually impossible to find a simple source code showing how it's done? Thanks, Rodrigo -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75567#75567 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org