class SineSphere extends SCPattern {
private SinLFO yrot = new SinLFO(0, TWO_PI, 2000);
- public final Projection sinespin;
+ public final LXProjection sinespin;
float modelrad = sqrt((model.xMax)*(model.xMax) + (model.yMax)*(model.yMax) + (model.zMax)*(model.zMax));
Pick Sshape;
public final PVector P = new PVector();
SineSphere(GLucose glucose)
{
super(glucose);
- sinespin = new Projection(model);
+ sinespin = new LXProjection(model);
addModulator(yrot).trigger();
//Sshape = addPick("Shape", , 1);
spherys = new Sphery[] {
private final int MAXIMUM_BEATS_PER_REVOLUTION = 100;
private boolean first_run = true;
- private final Projection projection;
+ private final LXProjection projection;
private final BasicParameter beatsPerRevolutionParam = new BasicParameter("SLOW", 20./MAXIMUM_BEATS_PER_REVOLUTION);
private final BasicParameter hueDeltaParam = new BasicParameter("HUED", 60./360);
private final BasicParameter fadeFromCoreParam = new BasicParameter("FADE", 1);
Gimbal(GLucose glucose) {
super(glucose);
- projection = new Projection(model);
+ projection = new LXProjection(model);
addParameter(beatsPerRevolutionParam);
addParameter(hueDeltaParam);
addParameter(fadeFromCoreParam);
// Translate so the center of the car is the origin
.center();
- for (Coord c : projection) {
+ for (LXVector c : projection) {
//if (first_run) println(c.x + "," + c.y + "," + c.z);
rotate3d(c, a, 0, 0);
this.girth = girth;
}
- public color colorFor(Coord c) {
+ public color colorFor(LXVector c) {
float theta = atan2(c.y, c.x);
float nearest_circle_x = cos(theta) * radius;
float nearest_circle_y = sin(theta) * radius;
class Zebra extends SCPattern {
- private final Projection projection;
+ private final LXProjection projection;
SinLFO angleM = new SinLFO(0, PI * 2, 30000);
/*
Zebra(GLucose glucose) {
super(glucose);
- projection = new Projection(model);
+ projection = new LXProjection(model);
addModulator(angleM).trigger();
}
- color colorFor(Coord c) {
+ color colorFor(LXVector c) {
float hue = lx.getBaseHuef();
// Translate so the center of the car is the origin
.center();
- for (Coord c : projection) {
+ for (LXVector c : projection) {
// rotate3d(c, a, b, g);
colors[c.index] = colorFor(c);
}
}
-void rotate3d(Coord c, float a /* roll */, float b /* pitch */, float g /* yaw */) {
+void rotate3d(LXVector c, float a /* roll */, float b /* pitch */, float g /* yaw */) {
float cosa = cos(a);
float cosb = cos(b);
float cosg = cos(g);
class Swim extends SCPattern {
// Projection stuff
- private final Projection projection;
+ private final LXProjection projection;
SawLFO rotation = new SawLFO(0, TWO_PI, 19000);
SinLFO yPos = new SinLFO(-25, 25, 12323);
final BasicParameter xAngle = new BasicParameter("XANG", 0.9);
public Swim(GLucose glucose) {
super(glucose);
- projection = new Projection(model);
+ projection = new LXProjection(model);
addParameter(xAngle);
addParameter(yAngle);
float model_height = model.yMax - model.yMin;
float model_width = model.xMax - model.xMin;
- for (Coord p : projection) {
+ for (LXVector p : projection) {
float x_percentage = (p.x - model.xMin)/model_width;
// Multiply by 1.4 to shrink the size of the sin wave to be less than the height of the cubes.
// Projection stuff
- private final Projection projection;
+ private final LXProjection projection;
SinLFO sphere1Z = new SinLFO(0, 0, 15323);
SinLFO sphere2Z = new SinLFO(0, 0, 8323);
public Balance(GLucose glucose) {
super(glucose);
- projection = new Projection(model);
+ projection = new LXProjection(model);
addParameter(hueScale);
addParameter(phaseParam);
.rotate(rotationX.getValuef() * crazy_factor, 0, 0, 1)
.rotate(rotationY.getValuef() * crazy_factor, 0, 1, 0);
- for (Coord p : projection) {
+ for (LXVector p : projection) {
float x_percentage = (p.x - model.xMin)/modelWidth;
float y_in_range = heightMod.getValuef() * (2*p.y - model.yMax - model.yMin) / modelHeight;
*/
class TestProjectionPattern extends TestPattern {
- private final Projection projection;
+ private final LXProjection projection;
private final SawLFO angle = new SawLFO(0, TWO_PI, 9000);
private final SinLFO yPos = new SinLFO(-20, 40, 5000);
public TestProjectionPattern(GLucose glucose) {
super(glucose);
- projection = new Projection(model);
+ projection = new LXProjection(model);
addModulator(angle).trigger();
addModulator(yPos).trigger();
}
.scale(1, 1.5, 1);
float hv = lx.getBaseHuef();
- for (Coord c : projection) {
+ for (LXVector c : projection) {
float d = sqrt(c.x*c.x + c.y*c.y + c.z*c.z); // distance from origin
// d = abs(d-60) + max(0, abs(c.z) - 20); // life saver / ring thing
d = max(0, abs(c.y) - 10 + .1*abs(c.z) + .02*abs(c.x)); // plane / spear thing
import glucose.effect.*;
import glucose.model.*;
import glucose.pattern.*;
-import glucose.transform.*;
import glucose.transition.*;
import heronarts.lx.*;
import heronarts.lx.control.*;
import heronarts.lx.effect.*;
import heronarts.lx.modulator.*;
import heronarts.lx.pattern.*;
+import heronarts.lx.transform.*;
import heronarts.lx.transition.*;
import ddf.minim.*;
import ddf.minim.analysis.*;