Discussion:
Using osg::DrawArrayLengths problem
徐华兵
2007-07-05 02:37:04 UTC
Permalink
osg-users:
Hello! When I use the core osg primitiveset, I see five derived class from it, and I don't know the osg::DrawArrayLengths ,it sounds to contain a std::vector, but unlike DrawElementsUByte(Int Short)which contain std::vector, it also have a variable member "fisrt".And how it acts.Can you give me a simple example to explain it?
Thanks!
Robert Osfield
2007-07-05 10:11:58 UTC
Permalink
Post by 徐华兵
Hello! When I use the core osg primitiveset, I see five derived class from it, and I don't know the osg::DrawArrayLengths ,it sounds to contain a std::vector, but unlike DrawElementsUByte(Int Short)which contain std::vector, it also have a variable member "fisrt".And how it acts.Can you give me a simple example to explain it?
DrawArrayLengths is simply a compact way of doing multiple
glDrawArray, the vector that DrawArrayLengths has contains the lengths
of the glDrawArray calls, the initial offset use is _first, then next
glDrawArray call uses _first + lenght of first array call.

For examples of an OSG class in action do a search through the OSG
source code, grep is your friend.

Robert.
Alberto Luaces
2007-07-05 10:20:30 UTC
Permalink
 Hello! When I use the core osg primitiveset, I see five derived class from
it, and I don't know the osg::DrawArrayLengths ,it sounds to contain a
std::vector, but unlike DrawElementsUByte(Int Short)which contain
std::vector, it also have a variable member "fisrt".And how it acts.Can you
give me a simple example to explain it? Thanks!
osg::DrawArray maps the functionality of OpenGL function glDrawArrays(). See
it at:

http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/drawarrays.html

A good place to know how to use it is found at the osggeometry example. I
don't know osg::DrawArrayLengths, might be a minor twist from osg::DrawArray.
Reading OSG source code will clarify that.

HTH,

Alberto

Loading...