[osg-users] Rotation of a node starts clockwise and ends counter-clockwise.
Sebastian Messerschmidt
sebastian.messerschmidt at gmx.de
Fri Aug 14 04:07:15 PDT 2015
Am 12.08.2015 um 20:09 schrieb Elias Tarasov:
> Hi, Sebastian!
> Thanks for help and quick answer.
> I've tested your suggestion, but failed.
> The problem i have now is that after i replaced MatrixTransform by DOFTransform, i lost all my engines, that i previously attached to main frame by using MatrixTransform
> The code (try to attach only one engine to main osg::Group frame for short)
>
> Code:
>
> ref_ptr<DOFTransform> transform = new DOFTransform;
> transform->addChild( nodeEngineCCW.get() );
> transform->setCurrentTranslate( Vec3(0.0, 0.0, 0.0) );
> groupAircraft->addChild( transform.get() );
I think you will need to set the scale member, as it is default
intialized with 0,0,0.
Also you might want to adjust the place matrix (e.g. the direction of
the DoF)
osg::Matrix dof_put_matrix;
dof_put_matrix.setRotate(osg::Quat(0.0, axis));
dof->setCurrentScale(osg::Vec3(1,1,1));
dof->setPutMatrix(dof_put_matrix);
Cheers
Sebastian
>
>
>
>
> It is expected that the engine must be right in the center of the model (as it was happend with the MatrixTransform), but it is not.
>
> Fucntion member setCurrentTranslate seems the most suitable candidate to move child nodes.
> I was not able to find any significant example of using it neither in examples, supplied by OSG, nor in google. Doxygen docs on this class tell almost nothing.
>
> For instance, maybe setCurrentTranslate argument doesn't have a meaning of a vector with respect to a parent?
> Could you provide an example ( link, or something) ?
>
> Thank you for your help and patience!
>
> Cheers,
> Elias
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=64748#64748
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
More information about the osg-users
mailing list