[EMAIL PROTECTED] wrote on 19/05/2006 12:28:22:
> 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 !!
I create a visitor class and add a custom accessor:
class ConstVecValueVisitor : public ConstValueVisitor {
public:
ConstVecValueVisitor() : ConstValueVisitor() {}
virtual ~ConstVecValueVisitor() {}
virtual void apply(const Vec3& v) {_value3 = v;}
const Vec3& value() const {return _value;}
private:
Vec3 _value;
};
Then call it like this:
const Array* ary = getVertexArray();
if (ary) {
for (size_t i = 0; i < ary->getNumElements(); ++i) {
ary->accept(i, visitor);
// Do something cool with visitor.value()
}
}
John Donovan
Sony Computer Entertainment Europe
http://www.scee.com
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
[EMAIL PROTECTED]
This footnote also confirms that this email message has been checked
for all known viruses.
**********************************************************************
Sony Computer Entertainment Europe
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/