setColorIndices, setVertexIndices, etc., allow you to have a different set
of indices for each array, so that (for example) the vertex with index 89
could be drawn with the color with index 42. Sounds really flexible, but
unfortunately there's no way to do this in OpenGL 1.x/2.x other than the
slow path, and no way to do it in OpenGL 3.x at all, so applications should
not use it for performance-critical rendering. (Oh! That's most all
rendering, isn't it? :-)

Instead, arrange your data so that colors and other vertex data have the
same index value as the vertex they are associated with, (vertex index 23 is
drawn with color index 23, etc), then use glDrawElements* as your
PrimitiveSet. This might require some duplication of data, but will render
much more efficiently.

Text along these lines should maybe be in the Geometry header next to the
"deprecated" warning.

Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
+1 303 859 9466

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Anton
Lauridsen
Sent: Monday, April 20, 2009 4:37 PM
To: [email protected]
Subject: [osg-users] Newbie question regarding deprecated methods

Hi,

I'm trying to learn to use OSG using the tutorials on the wiki, starting
with this:
http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/BasicGeome
try, during the coding, I learned that setColorIndices has been deprecated,
unfortunately I'm having difficulties figuring out what the preferred
replacements are.

I tried doing some searches, using the usual keywords, "deprecated",
"setColorIndices" etc, (hey I'm a newbie, I probably haven't got the
terminology right) I haven't had much luck with finding replacements. Is
there somewhere I can go and get some idea about what to use instead? or is
there a more up to date tutorial?

Thank you.

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=10482#10482





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to