Hi Lucian,

you can get the drawables' parent node with osg::Drawable::getParent and then 
the list of transformation matrices that you need to compute global 
coordinates with osg::Node::getWorldMatrices.

Regards,

Alberto

El Martes, 17 de Abril de 2007 09:36, [EMAIL PROTECTED] 
escribió:
> Hi!
> I am new to OSG, so excuse my rather basic question. I have an update
> callback for an object in the scene. In this callback I need to have
> the list of the object's vertices in the world coordinates. The
> problem is that I receive them in local coordinates system. Can anyone
> tell me ho I can obtain the world coordinates of the vertices? Here is
> the "apply" function definition of the update callback:
>
> virtual void apply(osg::Drawable::AttributeType type,unsigned int
> count,osg::Vec3* begin)
> {
>     if (type == osg::Drawable::VERTICES)
>     {
>        osg::Vec3* end = begin+count;
>        for (osg::Vec3* itr=begin;itr<end;++itr)
>        {
>           addStartPoint((itr)->x() + tr, //this is a function
>           (itr)->y() + tr, //of mine that uses the
>           (itr)->z() + tr); //vertex coords
>        }
>     }
> }
>
> The points that I give as parameter to the addStartPoint() function
> should be in the world's coordinate system. Does anybody know how to
> do that in OSG?
>
> Lucian Horga.
> OSG user.
>
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to