Re: [osg-users] LOS materail query

2015-08-28 Thread Mike Greene
OK, Got this working for some cases. For example, I used Lightwave to create a box with a colorbar texture placed on it so I would know for sure that the color returned was correct. The texture I used was a plain jpg. The problem is when using some other .ive , ost, or .osgt files. These

Re: [osg-users] LOS materail query

2015-08-27 Thread Robert Osfield
Hi Mike, OK, the next complication is probably that the osg::Texture has the probably unref'd the Image assigned to it after it's download to GL, the method that control it is in include/osg/Texture: /** Sets whether or not the apply() function will unreference the image *

Re: [osg-users] LOS materail query

2015-08-26 Thread Mike Greene
OK, fixed that - loaded an .ive file and was able to get correct looking texture coordinates. In a .ive file with embedded textures, is there a textureName? Probably not - not really important. But the code does say that there is one image in the texture. But doing the getImage(0) does not

Re: [osg-users] LOS materail query

2015-08-26 Thread Robert Osfield
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.

Re: [osg-users] LOS materail query

2015-08-26 Thread Mike Greene
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

Re: [osg-users] LOS materail query

2015-08-25 Thread Mike Greene
Hi, using the example, osgparticleeffects.cpp, I added the following lines of code to the pick function (inside the //MGREENE section): Code: void pick(osgViewer::Viewer* viewer, const osgGA::GUIEventAdapter ea) { osg::Group* root = dynamic_castosg::Group*(viewer-getSceneData());

Re: [osg-users] LOS materail query

2015-08-25 Thread Sebastian Messerschmidt
Hi, Hi, using the example, osgparticleeffects.cpp, I added the following lines of code to the pick function (inside the //MGREENE section): Code: void pick(osgViewer::Viewer* viewer, const osgGA::GUIEventAdapter ea) { osg::Group* root =

Re: [osg-users] LOS materail query

2015-08-21 Thread Mike Greene
Thank you guys very much! Cheers, Mike -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64867#64867 ___ osg-users mailing list osg-users@lists.openscenegraph.org

Re: [osg-users] LOS materail query

2015-08-21 Thread Sebastian Messerschmidt
Hi Mike Hi, I am wanting to do a dust cloud when an entity (helicopter) lands on a terrain. Ideally, would like the color of the dust cloud to be similar to the material/texture that the entity is on. Is there a way to do a material/texture color query based on an entity position, kind of

Re: [osg-users] LOS materail query

2015-08-21 Thread Robert Osfield
Hi Mike, In the osgUtil::LineSegmentItersector::Intersection object there is now (in OSG-3.2 onwards) the convenience method: /** Convenience function for mapping the intersection point to any textures assigned to the objects intersected. * Returns the Texture pointer