- JGraphAdapterDemo graph1;
-
-
-// class SpinningCube extends SCPattern{
-// LXProjection spin1, spin2, spin3;
-// SawLFO
-
-//}
-
-
-
-
-
-class PixelGraph implements EdgeFactory<dPixel, dVertex> {
-
-dPixel p0; dPixel p1; dVertex v0;
-
-public dVertex createEdge(dPixel p0, dPixel p1) {
-
- return v0;
-
-}
-
-
-}
-
- class GraphTest extends SCPattern {
- JGraphAdapterDemo graph1;
-
-GraphTest( LX lx) {super(lx); JGraphAdapterDemo graph1 = new JGraphAdapterDemo();}
-
- void run(double deltaMs){
- }
-}
-
-class SpinningCube extends SCPattern{
-
- LXProjection spin1, spin2, spin3;
- SawLFO spinx, spiny, spinz;
- SinLFO spinx1, spiny1, spinz1, cubesize;
- BasicParameter xoff = new BasicParameter("xoff", 10, 0, 100);
- BasicParameter toff = new BasicParameter("toff", 10,0,1000);
- BasicParameter huev = new BasicParameter("hue", 200, 0, 360);
- BasicParameter density = new BasicParameter("density", 0, 0, 1);
- BasicParameter Vsize = new BasicParameter("size", model.xMax/3,0, model.xMax);
- VirtualCube V1, V2, V3;
- PVector P = new PVector();
- float noisetime=0.;
- class VirtualCube {
- float x,y,z,d;
- PVector center;
-
- VirtualCube(float x, float y, float z, float d) {
- this.x=x;
- this.y= y;
- this.z=z;
- this.d=d;
- this.center=new PVector(x,y,z);
- }
-
- color getcolor(LXVector q) {
- if ( q.x > this.x + d/2 || q.x < this.x - d/2 || q.y > this.y + d/2 || q.y < this.y - d/2 || q.z > this.z + d/2 || q.z < this.z - d/2 )
- {return 0;}
- else {
- return lx.hsb(huev.getValuef()*noise(xoff.getValuef()*.001*noisetime ) , constrain(100*noise(xoff.getValuef()*.001*q.x*noisetime), 0, 100), max(100*(noise(xoff.getValuef()*.001*q.x*noisetime)-density.getValuef()), 0) );
- }
- }
- void setcenter(float x, float y, float z) {this.x=x; this.y = y; this.z=z; }
- void setsize(float din){ this.d=din ; }
-
- }
-
-SpinningCube(LX lx) {
- super(lx);
- addParameter(xoff);
- addParameter(toff);
- addParameter(Vsize);
- addParameter(huev);
- addParameter(density);
- //addModulator()
- V1 = new VirtualCube(model.cx, model.cy, model.cz, model.xMax/2);
- spinx= new SawLFO(0, TWO_PI, 8000);
- spin1 = new LXProjection(model);
-
-}
-
-
-void run(double deltaMs) {
-
- noisetime+= deltaMs*.0001*toff.getValuef();
-
-spin1.reset()
-.center()
-//.scale ()
-.rotate(spinx.getValuef(),0, 1, 0)
-.translate(model.cx, model.cy, model.cz);
-
-for (LXVector p: spin1) {
- P.set(p.x, p.y, p.z);
-
- colors[p.index] = V1.getcolor(p);
-
-}
-
-V1.setsize(Vsize.getValuef());
-
-
-};
-
-
-}
-
-
-
-
-