-don
On 10/13/06, Robert Osfield <[EMAIL PROTECTED]> wrote:
Hi Don,
I'm afriad odd the top of my head I don't have a quick solutions. Perhaps you could convert your geometries to non indxed ones, from src/osgUtil/TripStripVisitor.cpp:
// check to see if vertex attributes indices exists, if so expand them to remove them
if (geom.suitableForOptimization())
{
// removing coord indices
osg::notify(osg::INFO)<<"TriStripVisitor::stripify(Geometry&): Removing attribute indices"<<std::endl;
geom.copyToAndOptimize(geom);
}
As a general note, indexed vertex arrays are a pain to manage and force the OSG down onto OpenGL slow paths - so one thing I'm considering is that removing support for them is one thing it might be good to do with osg::Geometry in the longer term.On 10/10/06, Don Burns < [EMAIL PROTECTED]> wrote:Hi Robert,_______________________________________________
I was actually mistaken on this. It looks like there is support for DrawArrayLengths. I jumped to this conclusion because of the seeming missing method for drawArrayLengths in TriangleFunctor, but discovered that drawArrayLengths are handles in the DrawArrayLengths::accept method, but converting it to multiple DrawArrays (makes sense, it was all I was going to do inside TriangleFunctor).
But my problem is still not solved. The issue really has to do with being able to get the intersected triangle in the IntersectVisitor, when vertex arrays are indexed (the real issue).
I think I understand why this is occuring: when arrays are indexed, a temporary cache of coordinates is set up in the TriangleFunctor and then it is treated as a simple unindexed DrawArray.
The problem then, is that when I get a hit in IntersectVisitor, I do not have the nice shortcut of having the three coordinates of the triangle intersected passed back in the hit record. I do have the primitive index, which I can use to find the coordinates again, but what I really need is indices, because what I'm after is the texture coordinates of the intersected triangle.
Is there a short-cut that's better than brute force searches of all vertices?
-don
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
