Hi Ash,
The OSG matrices are treated as row-major matrices (unlike OpenGL). So, you
should write :
osg::Matrixd mat;
mat.set ( 1, 0, 0, 0
0, 1, 0, 0,
0, 0, 1, 0,
0, 20, 0, 1 );
to get a rigid translation. The second matrix isn't a rotation matrix, for a
rotation around the z axis, you should have something like :
osg::Matrixd mat;
mat.set ( cos(alpha), sin(alpha), 0, 0
-sin(alpha), cos(alpha), 0, 0,
0, 0, 1, 0,
0, 0, 0, 1 );
Hope this helps,
Mourad
On Fri, Oct 23, 2009 at 10:28 PM, Ash Pat <[email protected]> wrote:
> Hi,
> So I tried the MatrixTransform but it seems to skew the geometry.
> When I tried a matrix shown below, I was expecting a simple rigid body
> translation. But instead I got a display with massive extents.
>
> osg::Matrixd mat;
> mat.set ( 1, 0, 0, 0
> 0, 1, 0, 20,
> 0, 0, 1, 0,
> 0, 0, 0, 1 );
>
> Then I tried the following to get some rigid body rotation. What I'm seeing
> is almost like a rotation with a shear.
>
> osg::Matrixd mat;
> mat2.set ( 1, 1.57, 0, 0,
> 0, 1, 0, 0,
> 0, 0, 1, 0,
> 0, 0, 0, 1 );
>
> What am I doing wrong?
>
> Thanks,
>
> Regards,
>
> Ash
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=18641#18641
>
>
>
>
>
> _______________________________________________
> 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