On 5/19/06, Dorian Dussel <[EMAIL PROTECTED]> wrote:
Hello,
 
How can I get the coordinates of my vertices ?
I did :
osg::Array* array = myGeometry->getVertexArray();
But after I don't know !!
 
Excuse-me for my newbie's questions but maybe it could be useful for others newbies !!

You'll need to dyanmic_cast<Vec3Aray*> to get to the vertices, but its possible that this will fail if the model has been created with Vec2Array or Vec4Array etc - flexibility that's invaluable for certain tasks, but does mean that you can't make assumptions.  99.9% of the time a getVertexArray() will be Vec3Array though so it'll probably be ok.

To help manage this you could create yourself a ArrayVisitor, or go via the genertic attribute functor methods in Drawable.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to