Hi Mike, The osgparticleeffects demo uses a ShapeDrawable for rendering the terrain, this keeps the code straight forward but it does mean there isn't an osg::Geometry for the vertices and tex coords to hang off as all the geometry data is created on the fly and embedded in a display list. Please remember this example is written to demonstrate how to do particle effects, it's not an example for rendering terrain etc.
Try using a scene graph that actually use osg::Geometry and you shoudl have better luck. Robert. On 26 August 2015 at 13:24, Mike Greene <mgre...@hiwaay.net> wrote: > 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 : > > Code: > > 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! > > Cheers, > Mike[/code] > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=64903#64903 > > > > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org