For the purpose of animating materials, is there a way to construct a sine wave function out of Math nodes?
A while back I asked about how to do something similar with scripted driver expressions. But drivers don't work for animating materials (yet). They also are not currently supported in Blend4Web, which is where this will ultimately be used (with the B4W_TIME node driving the incremented value by frame).
So let's start with a keyframed Value node that increments by 1 for each frame. And that is factoring a MixRGB node with two mixed colors.
Since 0 will be 100% the top color, and 1 will be 100% the bottom color, going from frame 0 to frame 1 instantly changes the mix completely. Inserting a Math (Multiply) node slows this process, so for example if multiplied by 0.05 it will take 20 frames to shift from red to blue, and at frame 10 it will be half/half (purple).
So what about animating it so that it oscillates between two colors? Can this sort of sine wave animation be constructed using Math nodes?
(Note: This must be achievable using the Blender Internal Render Engine.)
Thanks