Jason Daly wrote:
> 
> Just to make sure you understand everything, some primitive sets include 
> an index list, and others don't.  You'll need to be sure you're 
> accessing one of the DrawElements primitive sets to be able to get an 
> index list.
> 
> If you're sure your PrimitiveSet is a DrawElements, try this instead:
> 
> indices[i] = (*_indices)[i];
> 
> or
> 
> indices[i] = _indices->at(i);
> 
> The first version is a direct access (and might be slightly quicker), 
> and the second will do range checking and will throw an exception if you 
> try to access something outside the bounds of the list.  The 
> DrawElements class itself is a descendant of std::vector, so you can 
> just access it using the standard vector methods.  You don't need to go 
> all the way down to the data pointer.
> 


_indices is osg::PrimitiveSet, so it throws an error:

error C2676: binary '[' : 'osg::PrimitiveSet' does not define this operator or 
a conversion to a type acceptable to the predefined operator

So i've got the wrong primitive set?(i've checked final "indices" first 20 
values. and they are:


Code:
Ind = 2066
Ind = 2064
Ind = 0
Ind = 2065
Ind = 2060
Ind = 2064
Ind = 2066
Ind = 166
Ind = 2065
Ind = 2066
Ind = 2065
Ind = 2064
Ind = 2066
Ind = 0
Ind = 2068
Ind = 2066
Ind = 2067
Ind = 166
Ind = 2067
Ind = 2068

 

pretty strange...)

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





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

Reply via email to