Ok, sorry, NL/CR appear to be messed up again (fix below):
... and changing the code to color[0] = bs[0]; I get something that I would expect: Before blink code (original color): After blink code 0.0156863, 0.0117647, 0.294118, 1 : 0, 0, 0, 0 0.0156863, 0.0117647, 0.294118, 1 : 0, 0, 0, 0 0.0156863, 0.0117647, 0.294118, 1 : 0.00824952, 0.00618714, 0.154678, 0.525907 0.0156863, 0.0117647, 0.294118, 1 : 0.0156863, 0.0117647, 0.294118, 1 0.0156863, 0.0117647, 0.294118, 1 : 0.0156863, 0.0117647, 0.294118, 1 0.0156863, 0.0117647, 0.294118, 1 : 0.0156863, 0.0117647, 0.294118, 1 0.0156863, 0.0117647, 0.294118, 1 : 0.0156863, 0.0117647, 0.294118, 1 0.0156863, 0.0117647, 0.294118, 1 : 0.0156863, 0.0117647, 0.294118, 1 0.0156863, 0.0117647, 0.294118, 1 : 0.0156863, 0.0117647, 0.294118, 1 0.0156863, 0.0117647, 0.294118, 1 : 0.0156863, 0.0117647, 0.294118, 1 0.0156863, 0.0117647, 0.294118, 1 : 0.00896023, 0.00672017, 0.168004, 0.571214 0.0156863, 0.0117647, 0.294118, 1 : 0, 0, 0, 0 0.0156863, 0.0117647, 0.294118, 1 : 0, 0, 0, 0 -B -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Brad Colbert Sent: Friday, June 22, 2012 10:37 AM To: 'OpenSceneGraph Submissions' Subject: Re: [osg-submissions] LightPointNode.cpp:304 Incorrect application of blink Robert, Sorry, if this message has all the data on one line. I'm replying to it to fix it: ... I'm printing out the color values before and after the blink and they don't ever get to the original color value but something less (LightPointNode.cpp): Before blink (original color) : After blink code 0.0156863, 0.0117647, 0.294118, 1 : 0, 0, 0, 0 0.0156863, 0.0117647, 0.294118, 1 : 0, 0, 0, 0 0.0156863, 0.0117647, 0.294118, 1 : 0.00011779, 6.62568e-05, 0.0414105, 0.478705 0.0156863, 0.0117647, 0.294118, 1 : 0.000246059, 0.000138408, 0.0865052, 1 0.0156863, 0.0117647, 0.294118, 1 : 0.000246059, 0.000138408, 0.0865052, 1 0.0156863, 0.0117647, 0.294118, 1 : 0.000246059, 0.000138408, 0.0865052, 1 0.0156863, 0.0117647, 0.294118, 1 : 0.000246059, 0.000138408, 0.0865052, 1 0.0156863, 0.0117647, 0.294118, 1 : 0.000246059, 0.000138408, 0.0865052, 1 0.0156863, 0.0117647, 0.294118, 1 : 0.000246059, 0.000138408, 0.0865052, 1 0.0156863, 0.0117647, 0.294118, 1 : 0.000246059, 0.000138408, 0.0865052, 1 0.0156863, 0.0117647, 0.294118, 1 : 0.000246059, 0.000138408, 0.0865052, 1 0.0156863, 0.0117647, 0.294118, 1 : 0.000246059, 0.000138408, 0.0865052, 1 0.0156863, 0.0117647, 0.294118, 1 : 0.000246059, 0.000138408, 0.0865052, 1 0.0156863, 0.0117647, 0.294118, 1 : 0.000246059, 0.000138408, 0.0865052, 1 0.0156863, 0.0117647, 0.294118, 1 : 0.000124087, 6.97988e-05, 0.0436243, 0.504297 0.0156863, 0.0117647, 0.294118, 1 : 0, 0, 0, 0 0.0156863, 0.0117647, 0.294118, 1 : 0, 0, 0, 0 If you think of the math at this point, simply looking at the red component: 0.000246059 = 0.0156863 * 0.0156863 which is color[0] *= bs[0]; where I believe bs[0] contains the value that is already interpolated before, during, and after the blink. So... color[0] = bs[0]; Appears to produce the correct result. -B -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Robert Osfield Sent: Friday, June 22, 2012 3:38 AM To: [email protected] Subject: Re: [osg-submissions] LightPointNode.cpp:304 Incorrect application of blink Hi Brad, I wrote the code with the multiplication in such as way as the blink sequence modulates the original colour of the light point rather than replacing it so the original code is correct as per it's original intended functionality. What you are doing is changing the basic functionality which is inappropriate as it'll break other users applications. Robert. On 21 June 2012 23:17, Brad Colbert <[email protected]> wrote: > Hi, > > I believe that the application of the blink sequence to the color of a > lightpoint is incorrect. Currently the code is this: > > Line 304: > osg::Vec4 bs = lp._blinkSequence->color(time,timeInterval); > color[0] *= bs[0]; > color[1] *= bs[1]; > color[2] *= bs[2]; > color[3] *= bs[3]; > > and I believe it is supposed to be this: > > osg::Vec4 bs = lp._blinkSequence->color(time,timeInterval); > color[0] = bs[0]; > color[1] = bs[1]; > color[2] = bs[2]; > color[3] = bs[3]; > > The issue is that the color of the lightpoint is being squared. > > > Thank you! > > Cheers, > Brad > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=48418#48418 > > > > > Attachments: > http://forum.openscenegraph.org//files/lightpointnode_995.cpp > > > _______________________________________________ > 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 _______________________________________________ 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 _______________________________________________ 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
