Sean Spicer wrote:
I came across a nasty little bug today:

(a) Create an osg::Geometry and assign a vertex array that is an osg::Vec4Array
(b) Try to pick with a LineSegmentIntersector
(c) CRASH

Digging a little bit, it looks like LineSegmentIntersector assumes
that vertex arrays are always of type osg::Vec3Array.  Are there any
plans to change this ?  It looks like a tedious, but not terribly
invasive change.

Interesting find, Sean...

My first reaction is, "Why would you ever use a Vec4Array for vertex coordinates?!", but an equally valid counter-argument would be that OpenGL allows 4-element vertices them, so OSG should support them.

Next, you have to ask how to intersect a line segment with a geometry with Vec4Array vertices. Would you have to do the w-divide on the vertices before you did the intersection tests to be correct, or is it more correct to not do it, or do you have to do the modelview transform, then the w-divide, then the intersection...

Then, you have to start wondering if there are any other assumptions like this being made anywhere (I found other possible cases in Tessellator and Optimizer, though it looks as if they just bail out instead of crashing when they don't find a Vec3Array).

I think you may have opened a can of worms here  :-)

--"J"

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

Reply via email to