Hi Monia,
You have several options open to you:
1) Write a custom CameraManipulator along the lines of one of the
existing ones in src/osgGA
2) Not use a CameraManipulator on the view and use a Camera update
callback to set the ViewMatrix
once per frame
3) Set the Camera's ViewMatrix directly within the frame loop i.e.
expand viewer.run() out into:
// note, don't assign a CameraManipulator
viewer.realize();
while(!viewer.done())
{
// your code for computing myViewMatrix
viewer.getCamera()->setViewMatrix(myViewMatrix);
viewer.frame();
}
or with frame itself expanded
// note, don't assign a CameraManipulator
viewer.realize();
while(!viewer.done())
{
// your code for computing myViewMatrix
viewer.advance();
viewer.eventTraversal();
viewer.updateTraversal();
viewer.getCamera()->setViewMatrix(myViewMatrix);
viewer.renderingTraversals();
}
On Wed, Jun 4, 2008 at 9:45 AM, monia hamdi <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I want to set the Camera's ViewMatrix manually myself given the
> SpaceNavigator data.
>
> Thanks
>
>
> --- En date de : Mer 4.6.08, Robert Osfield <[EMAIL PROTECTED]> a
> écrit :
>
> De: Robert Osfield <[EMAIL PROTECTED]>
> Objet: Re: [osg-users] 3Dconnexion manipulator
> À: [EMAIL PROTECTED], "OpenSceneGraph Users"
> <[email protected]>
> Date: Mercredi 4 Juin 2008, 10h22
>
> Hi Monia,
>
> It's not clear what you actually want to do with your system - is it
> that you want objects in the scene controlled by the SpaceNavigator or
> is
> that you don't want the usual CameraManipulator but set the
> Camera's ViewMatrix manually yourself given the SpaceNavigator data?
>
> Robert.
>
> On Wed, Jun 4, 2008 at 8:57 AM, monia hamdi <[EMAIL PROTECTED]> wrote:
>> Hi ,
>> I have a SpaceNavigator device and I succeeded to get the translation and
>> the quaternion matrix. In my application, I have a camera manipulator
> (using
>> mouse and keyboard) and I want to add the spaceNavigator.
>>
>> in each frame, the quat matrix and the translation vector are updated.
>> Would you please give me the most suitable example that I can adapt for my
>> case.
>>
>> Thank you
>> Monia
>>
>>
>>
>> __________________________________________________
>> Do You Yahoo!?
>> En finir avec le spam? Yahoo! Mail vous offre la meilleure protection
>> possible contre les messages non sollicités
>>
> http://mail.yahoo.fr Yahoo! Mail
>> _______________________________________________
>> osg-users mailing list
>> [email protected]
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>
>
> __________________________________________________
> Do You Yahoo!?
> En finir avec le spam? Yahoo! Mail vous offre la meilleure protection
> possible contre les messages non sollicités
> http://mail.yahoo.fr Yahoo! Mail
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org