Thanks Harwig, I've applied the change to git master, 3.2 and 3.4 branches. In future could post a git pull request or the whole modified file as these approaches are far more reliable. Cheers Rober6
On 20 November 2016 at 16:40, Hartwig Wiesmann <[email protected]> wrote: > Hi, > > ScalarsToColors should return values from black to white. But if the passed > value to getColor is larger than max also black is returned (see code below). > > > Code: > > osg::Vec4 ScalarsToColors::getColor(float scalar) const > { > if(scalar<_min) return osg::Vec4(0.0f,0.0f,0.0f,0.0f); > if(scalar>_max) return osg::Vec4(0.0f,0.0f,0.0f,0.0f); > > float c = (_min+scalar)/(_max-_min); > return osg::Vec4(c,c,c,1.0); > } > > > > > This code should be corrected to > > Code: > > osg::Vec4 ScalarsToColors::getColor(float scalar) const > { > if(scalar<_min) return osg::Vec4(0.0f,0.0f,0.0f,0.0f); > if(scalar>_max) return osg::Vec4(1.0f,1.0f,1.0f,1.0f); > > float c = (_min+scalar)/(_max-_min); > return osg::Vec4(c,c,c,1.0); > } > > > > > Thank you! > > Cheers, > Hartwig > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=69452#69452 > > > > > > _______________________________________________ > osg-submissions mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
