[osg-users] Fwd: CallBack issue

ami guru dosto.walla at gmail.com
Fri Mar 27 18:01:14 PDT 2009


Thanks Paul and Ulrich


It works fine now.

I have some issue to discuss about Callbacks


With callbacks we dynamically modify the node during the update traversal.So
any node that has already gone through some affine transformation will be
replaced in the call backs, but not concatenated.


On  the other hand if we specify any affine trnasformation after calling the
callback, the last transformation will be concatenated to the one that have
been assigned durng callbacks.


And that happens to any type of dynamic transformation , not only with the
affine one.


Please correct me if i misunderstood the concept.



Regards
Sajjad

---------- Forwarded message ----------
From: Ulrich Hertlein <u.hertlein at sandbox.de>
Date: Sat, Mar 28, 2009 at 12:24 AM
Subject: Re: [osg-users] CallBack issue
To: OpenSceneGraph Users <osg-users at lists.openscenegraph.org>


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
_______________________________________________
osg-users mailing list
osg-users at lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20090328/c780a5cb/attachment-0003.htm>


More information about the osg-users mailing list