Martin Beckett wrote:
I need the geometry node to contain some extra meta data and an extra value for
each vertex (a quality filed) there is no change to how the Node is drawn.
I'm looking for the best way to do this:
1, Patch the source - probably a bad idea!
2, Store the data separately with a pointer to the Geometry node.
3, Derive from Geometry, since OSG only uses pointers to store nodes,
everything else should work (except I can't save the extra data in an osg file)
4, Write a NodeKit. Is this overkill to just store a few extra fields? I don't want to change how the Node is rendered.
Are there any samples of how to write a nodekit.?
Is the per-vertex data something you can fit in a float or
Vec2/Vec3/Vec4? If so, how about just a generic vertex attribute?
The extra meta-data can be attached using the setUserData() method (look
at osg/Object). You just have to derive a class from osg::Referenced;
then you can attach it to any osg::Object.
--"J"
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org