<div dir="ltr"><div><div><div>Hi Mike,<br><br></div>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.<br><br></div>Try using a scene graph that actually use osg::Geometry and you shoudl have better luck.<br><br></div>Robert.<br><div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 26 August 2015 at 13:24, Mike Greene <span dir="ltr"><<a href="mailto:mgreene@hiwaay.net" target="_blank">mgreene@hiwaay.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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.<br>
<br>
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.<br>
<br>
For example, one of the hit outputs that I ran returned an X,Y,Z of<br>
838.203, 840.662, 268.477 (LocalIntersectPoint), but the texture returned is NULL and of course then tc is (0,0,0).<br>
<br>
Debugging the code for getTextureLookup, the first two lines :<br>
<br>
Code:<br>
<br>
osg::Texture* LineSegmentIntersector::Intersection::getTextureLookUp(osg::Vec3& tc) const<br>
{<br>
osg::Geometry* geometry = drawable.valid() ? drawable->asGeometry() : 0;<br>
<span class=""> osg::Vec3Array* vertices = geometry ? dynamic_cast<osg::Vec3Array*>(geometry->getVertexArray()) : 0;<br>
<br>
<br>
<br>
<br>
</span>show that drawable.valid is true, but then the value of vertices is always all zeroes.<br>
...<br>
<span class=""><br>
Thank you!<br>
<br>
Cheers,<br>
Mike[/code]<br>
<br>
</span><span class="">------------------<br>
Read this topic online here:<br>
</span><a href="http://forum.openscenegraph.org/viewtopic.php?p=64903#64903" rel="noreferrer" target="_blank">http://forum.openscenegraph.org/viewtopic.php?p=64903#64903</a><br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</div></div></blockquote></div><br></div>