Are those colors (from the rainbow cubes) real-time generated? If not take this with you:
struct RGBA
{
float r;
float g;
float b;
gloat a;
}
float _arcoiris(float ti)
{
float tiDelta = floor(ti/360);
ti = ti - float(tiDelta*360);
if (ti<=240)
{
if (ti<120) // 0 - 119
{
return ti/119;
}
else // 120 - 239
{
return 1 - (ti-120)/119;
}
} else { // 240 - 360
return 0.0;
};
};
RGBA ArcoIris(float ti)
{
RGBA rgba;
rgba.r = _arcoiris(ti + 0 );
rgba.g = _arcoiris(ti + 120);
rgba.b = _arcoiris(ti + 240);
rgba.a = 1.0f;
return rgba;
}
Example:
t++;
RGBA color = ArcoIris(t)
glColor3f(color.r,color.g,color.b);
I Am giving you this piece of code for one reason: I Need motivation to work in my demo, and giving resources to everybody only makes my work harder, so i can get out of the bed and work more :3