int beat = 0;
float prevRamp = 0;
- void run(int deltaMs) {
+ void run(double deltaMs) {
// Sync to the beat
float ramp = (float)lx.tempo.ramp();
float denominator = max(xAngle.getValuef() + yAngle.getValuef() + zAngle.getValuef(), 1);
- projection.reset(model)
+ projection.reset()
// Swim around the world
.rotate(rotation.getValuef(), xAngle.getValuef() / denominator, yAngle.getValuef() / denominator, zAngle.getValuef() / denominator)
- .translateCenter(model, 0, 50 + yPos.getValuef(), 0);
+ .translateCenter(0, 50 + yPos.getValuef(), 0);
float model_height = model.yMax - model.yMin;
float model_width = model.xMax - model.xMin;
float v1 = sin_x > y_in_range ? (100 + 100*(y_in_range - sin_x)) : 0;
float hue_color = (lx.getBaseHuef() + hueScale.getValuef() * (abs(p.x-model.xMax/2.)*.3 + abs(p.y-model.yMax/2)*.9 + abs(p.z - model.zMax/2.))) % 360;
- colors[p.index] = color(hue_color, 70, v1);
+ colors[p.index] = lx.hsb(hue_color, 70, v1);
}
}
}
int beat = 0;
float prevRamp = 0;
- void run(int deltaMs) {
+ void run(double deltaMs) {
// Sync to the beat
float ramp = (float)lx.tempo.ramp();
float phase = phaseLFO.getValuef();
float crazy_factor = crazyParam.getValuef() / 0.2;
- projection.reset(model)
+ projection.reset()
.rotate(rotationZ.getValuef() * crazy_factor, 0, 1, 0)
.rotate(rotationX.getValuef() * crazy_factor, 0, 0, 1)
.rotate(rotationY.getValuef() * crazy_factor, 0, 1, 0);
float v1 = max(0, 100 * (1 - 4*abs(sin_x - y_in_range)));
float hue_color = (lx.getBaseHuef() + hueScale.getValuef() * (abs(p.x-model.xMax/2.) + abs(p.y-model.yMax/2)*.2 + abs(p.z - model.zMax/2.)*.5)) % 360;
- color c = color(hue_color, 60, v1);
+ color c = lx.hsb(hue_color, 80, v1);
// Now draw the spheres
for (Sphere s : spheres) {
float value = min(beat_value, distance_value);
- c = blendColor(c, color((hue_color + 180) % 360, 100, min(1, value) * 100), ADD);
+ float sphere_color = (lx.getBaseHuef() - (1 - hueScale.getValuef()) * d/r * 45) % 360;
+
+ c = blendColor(c, lx.hsb((sphere_color + 270) % 360, 60, min(1, value) * 100), ADD);
}
colors[p.index] = c;
}