Hi,
osg::TransferFunction1D::assignToImage may assign NaN values to the image in
case an underflow inside the method occurs. This underflow can be reproduced by
the following call sequence:
osg::TransferFunction1D* tf(new osg::TransferFunction1D());
tf->allocate(18);
tf->setColor(-10000,osg::Vec4( 1.0, 1.0, 1.0,1.0));
tf->setColor(-1e-6,osg::Vec4( 1.0, 1.0, 1.0,1.0));
tf->setColor( 0,osg::Vec4( 0.0, 0.0, 1.0,1.0));
Remark: The value -1e-6 may be added (falsely) because of a rounding error.
The attached fix prevents assigning NaN values to the image.
Cheers,
Hartwig
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=27180#27180
Attachments:
http://forum.openscenegraph.org//files/transferfunctioncpp_248.zip
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org