[osg-users] osgUtil::IntersectionVisitor, information on polygon intersected

Jean-Sébastien Guay jean-sebastien.guay at cm-labs.com
Wed Sep 17 13:28:49 PDT 2008

Hi Alberto,

Thanks for confirming my hunch about the ratioList. I've never used that 
functionality but I've been around the LineSegmentIntersector code a bit 
and I remembered it being something like that, but wasn't sure.

>> If that's the case, you can 
>> do the same with the triangle's texture coordinates at the 3 same
>> vertices and thus get where in the texture the hit occured.
> I'm not sure about this one, but it should give a reasonable approximation 
> anyway :)

You're right, there might be some other things like perspective 
correction that enter into the equation. I'd have to research the actual 
equations that OpenGL uses to calculate a texture coordinate based on 
the triangle's 3 vertices' texture coordinates in order to sample the 
texture at the right texel. It's probably well documented, but it's not 
the kind of thing I tend to memorize...

Anyways, I think we're going a bit further than what the OP asked. :-)


Jean-Sebastien Guay    jean-sebastien.guay at cm-labs.com

More information about the osg-users mailing list