Hi,
Maxime BOUCHER wrote:
For anyone who would read this thread an d reproduce the same, don't.
It seems the DrawArrayLengths contains a single number representing in a way I
don't understand the primitives EVEN IF you can access the primitives the same
way than for a DrawElementsUthing.
It's not that hard to understand. Take, for example, the cow.osg sample
file (check the file in a text editor). There's a Geometry node in there
with 1 primitive set, which is a DrawArrayLengths. The type of this
primitive set is TRIANGLE_STRIP, so it defines multiple triangle strips.
The numbers (3, 3, ....10, 14, 5, 5) represent the number of vertices
user *per triangle strip*. So the DrawArrayLengths defines a triangle
strip of 3 vertices (i.e. a single triangle), and then another strip of
3 vertices, etc. The vertices are simply used in order from the vertex
array. So the first triangle strip is defined with vertices 0, 1 and 2;
the second triangle strip by vertices 3, 4 and 5, etc.
In total, the DrawArrayLengths primitive set defines 984 triangle strips.
Geometry {
DataVariance DYNAMIC
[...]
useDisplayList TRUE
Primitives 1
{
DrawArrayLengths TRIANGLE_STRIP 0 984
{
3
3
....
10
14
5
5
}
}
VertexArray 7772
{
4.76334 -1.36791 3.02949
4.85496 -1.36297 3.09889
4.73514 -1.38955 3.08412
4.92619 0.143477 2.29847
4.98236 0.0975301 2.31196
4.94471 0.136714 2.27932
...
}
HTH,
Paul
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org