[osg-users] "LOS" materail query

Mike Greene mgreene at hiwaay.net
Wed Aug 26 05:24:30 PDT 2015

Yes, a null texture is the problem. I am using the osgparticleeffects example, as I know the object does have a texture. It is the example where you click on the terrain and at that point an explosion and smoke effect starts. 

But when printing out the coordinates of "hit" in the code above, they do show valid locations on the terrain whenever a mouse "clicks" on the terrain to place a particle effect. Using one of these valid "hits", I then use that intersection to try the texture return code.

For example, one of the hit outputs that I ran returned an X,Y,Z of 
838.203, 840.662, 268.477 (LocalIntersectPoint), but the texture returned is NULL and of course then tc is (0,0,0).

Debugging the code for getTextureLookup, the first two lines :


osg::Texture* LineSegmentIntersector::Intersection::getTextureLookUp(osg::Vec3& tc) const
    osg::Geometry* geometry = drawable.valid() ? drawable->asGeometry() : 0;
    osg::Vec3Array* vertices = geometry ? dynamic_cast<osg::Vec3Array*>(geometry->getVertexArray()) : 0;

show that drawable.valid is true, but then the value of vertices is always all zeroes.

Thank you!


Read this topic online here:

More information about the osg-users mailing list