Without giving away too much IP, one of the reasons why one might want to think about using Vec4Arrays is to take advantage of host-side SIMD operations - which commonly use 128bit registers (4 floats).
I agree, this is a can of worms. sean _________________________________________________________ Sean Spicer Executive Vice President & Chief Technology Officer Aqumin (www.aqumin.com) Office....+1.713.781.2121 Mobile...+1.713.447.2706 Fax.......+1.713.781.2123 On Thu, Mar 25, 2010 at 2:53 PM, Jason Daly <[email protected]> wrote: > 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 > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

