[osg-users] CallBack issue

Ulrich Hertlein u.hertlein at sandbox.de
Fri Mar 27 16:24:17 PDT 2009


Hello Ami,

On 28/3/09 8:50 AM, ami guru wrote:
>    virtual void operator()(osg::Node *node,
>                osg::NodeVisitor *nv)
>    {
>       osg::Matrix mR;
>      mR.makeRotate(m_angle, osg::Vec3(0.0f,0.0f,1.0f));
>
>      mtLeft->setMatrix(mR);
>...
>
>    osg::Vec3f teapotTransVec = osg::Vec3f(5,2,-12);
>    osg::Vec3f teapotScaleVec = osg::Vec3f(20.1f,20.1f,20.1f);
>    teapotTransMat.makeTranslate(teapotTransVec);
>    teapotScaleMat.makeScale(teapotScaleVec);
>
>    teapotPos->setMatrix(teapotTransMat * teapotScaleMat);

You're originally including a scaling transform in the Matrix.
The Callback operator replaces this with only a rotation matrix i.e. the scaling part is 
lost hence the object looks smaller.

Cheers,
/ulrich



More information about the osg-users mailing list