Sorry J-S,

It was so stupid to make such a mistake .

It did work now.


Thanks a lot.


On Wed, Apr 8, 2009 at 4:09 PM, ami guru <[email protected]> wrote:

> Hello J-S,
>
>
> I have already tried that , but i am not getting the output that i am
> looking for.
>
> The snippet is as follows:
>
>
> ********************'''
>   if (buttonMask == GUIEventAdapter::LEFT_MOUSE_BUTTON)
>     {
>       // rotate camera.
>
>       osg::Quat new_rotate;
>       osg::Quat new_rotate1;
>
>       new_rotate.makeRotate(dx / 3.0f, osg::Vec3(0.0f, 0.0f, 1.0f));
>       new_rotate1.makeRotate(dy / 3.0f, osg::Vec3(1.0f, 0.0f, 0.0f));
>
>       m_rotation = m_rotation * new_rotate   * new_rotate1 ;
>
>       return true;
>
>     }
>
>
>
> **********************'
>
> I am wrong in the concept i believe .
> Any hint to to do some trial and error ?
>
>
>
> Regards
> Sajjad
>
>
>
> On Wed, Apr 8, 2009 at 3:04 PM, Jean-Sébastien Guay <
> [email protected]> wrote:
>
>> Hello Sajjad,
>>
>>  I want to rotate the camera against X axis when the mouse is clicked and
>>> dragged vertically -  means against the X - axis. with very same left mouse
>>> click.
>>> Do i have to create another osg::Quat variable for that or use the
>>> existing one ?
>>>
>>
>> I'm confused - you have the code, why don't you experiment? You can change
>> the manipulator to do whatever you want.
>>
>> Hint: you can multiply whatever quaternion you have by another one that
>> rotates around the X axis by the y mouse input value you get. That will give
>> you a compound rotation which is the combination of both rotations.
>>
>> J-S
>> --
>> ______________________________________________________
>> Jean-Sebastien Guay    [email protected]
>>                               http://www.cm-labs.com/
>>                        http://whitestar02.webhop.org/
>> _______________________________________________
>> osg-users mailing list
>> [email protected]
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to