Hi
I am expecting my code to first rotate the point along y-axis and then
rotate the resultant point across x-axis. but only the rotation along
z is happening but not along x.
but its happening when i use a code like this:
---------------------------------------
osg::Matrixd mat,mat1;
mat.makeRotate(osg::DegreesToRadians(-45.0),osg::Vec3(.0,.0,1.0));
mat1.makeRotate(osg::DegreesToRadians(-45.0),osg::Vec3(1.0,.0,0.0));
osg::Vec3 temp(2000,0.0,0.0);
mat1=mat1*mat;
temp=mat1*temp;
--------------------------------------------
Is this an effecient way or are there some other ways ?
Also to make the desired 45 deg rotation along z and x axes I am
giving -45 as argument as you can see from the above code. If I give
45 deg then it is rotating in the clockwise direction. I am seeing the
output visually.
Why does this happen ?
Thank You
On Mon, Dec 22, 2008 at 2:42 PM, Vincent Bourdier
<[email protected]> wrote:
> Hi,
>
> It sound normal for me to have a y rotation for result.
> Make a little drawing, you will see that.
>
> Vincent.
>
> 2008/12/22 hemanth korrapati <[email protected]>
>>
>> hi all,
>>
>> I want to rotate a point which is on x-axis by 45 degrees w.r.t z-axis
>> and 45 degrees w.r.t x-axis. So I am using the following code
>>
>>
>> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>> osg::Matrixd mat;
>>
>>
>> mat.setRotate(osg::Quat(osg::DegreesToRadians(45.0),osg::Vec3d(.0,0.0,1.0))*osg::Quat(osg::DegreesToRadians(45.0),osg::Vec3d(1.0,0.0,0.0)));
>> osg::Vec3 temp(2000,0.0,0.0);
>> temp=mat*temp;
>>
>> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>
>> After this I see that only the point is rotated across y-axis(i.e the
>> first rotation) but not along x-axis. (only one rotation performed)
>> also it rotates in the negative direction.
>>
>> dows anyone know why these things happen ?
>> _______________________________________________
>> 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
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org