codes<\/em><\/strong>\u00a0<\/span><\/p>\n<\/p>\n
import peasy.test.*;\r\nimport peasy.org.apache.commons.math.*;\r\nimport peasy.*;\r\nimport peasy.org.apache.commons.math.geometry.*;\r\nimport ddf.minim.*;\r\n\r\nMinim minim;\r\nAudioPlayer player;\r\nPeasyCam cam;\r\n\r\nfloat spin = 0.0;\r\n\r\nSinWave sinW1;\r\nSinWave sinW2; \/\/time=0\r\nCosWave cosW1;\r\nCosWave cosW2; \/\/time=0;\r\nTanWave tanW1;\r\nTanWave tanW2; \/\/time=0;\r\n\r\n\/\/SinWave sw1;\r\n\/\/SinWave sw2;\r\n\/\/first circle\r\nArrayList<SinWave> sw1;\r\nArrayList<SinWave> sw2;\r\nArrayList<TanWave> tw;\r\nArrayList<CosWave> cw1;\r\n\r\n\/\/second circle\r\nArrayList<SinWave> sw1b;\r\nArrayList<SinWave> sw2b;\r\nArrayList<TanWave> twb;\r\nArrayList<CosWave> cw1b;\r\n\r\n\/\/3rd circle\r\nArrayList<SinWave> sw1c;\r\nArrayList<SinWave> sw2c;\r\nArrayList<TanWave> twc;\r\nArrayList<CosWave> cw1c;\r\n\r\nfloat frequency = 0.01;\r\nfloat time1 = PI\/2;\r\nfloat time2 = 0;\r\nfloat amplitude = 5;\r\nfloat offset = 0;\r\nfloat increaseAmp = 0.01;\r\nfloat increaseBri = 0.01;\r\nfloat increaseBri2 = 0.01;\r\nfloat increaseTime = 0.01;\r\nfloat radiusCircle = 0.0;\r\n\r\nfloat ang;\r\nfloat posX;\r\nfloat posY;\r\nfloat posZ;\r\n\r\nfloat posX2;\r\nfloat posY2;\r\nfloat posZ2;\r\n\r\nfloat posCX;\r\nfloat posCY;\r\n\r\nArrayList<Tetrahedron> triS;\r\nArrayList<Tetrahedron> triCircleS;\r\nArrayList<Tetrahedron> triCircle2S;\r\nArrayList<Tetrahedron> triCircle3S;\r\n\r\nfloat noiseVal;\r\nfloat noiseScale=0.02;\r\n\r\nint octaves;\r\nfloat falloff;\r\nfloat time;\r\n\r\nboolean increase = true;\r\n\r\nint circleNum = 60;\r\nfloat size;\r\n\r\n\/\/Camera\r\nfloat xmag, ymag = 0;\r\nfloat newXmag, newYmag = 0; \r\nfloat averagePosX = 0;\r\n\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ SET_UP \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\nvoid setup() {\r\n noCursor();\r\n noFill();\r\n \/\/stroke(255);\r\n size(1000, 800, P3D);\r\n colorMode(HSB,100);\r\n\r\n \/\/Camera-------------------------------------------------\r\n \/\/-------------------------------------------------------\r\n cam = new PeasyCam(this, 0, 0, 0, 1000);\r\n\/\/ cam.setActive(false);\r\n\/\/ cam.setYawRotationMode();\r\n\r\n \/\/audio\r\n minim = new Minim(this);\r\n player = minim.loadFile("No Safe-House.mp3");\r\n player.play();\r\n\r\n sinW1 = new SinWave(time1, frequency, amplitude, offset);\r\n sinW2 = new SinWave(time2, frequency, amplitude, offset);\r\n cosW1 = new CosWave(time1, frequency, amplitude, offset);\r\n cosW2 = new CosWave(time2, frequency, amplitude, offset);\r\n tanW1 = new TanWave(time1, frequency, amplitude, offset);\r\n tanW2 = new TanWave(time2, frequency, amplitude, offset);\r\n\r\n triS = new ArrayList<Tetrahedron>();\r\n triCircleS = new ArrayList<Tetrahedron>();\r\n triCircle2S = new ArrayList<Tetrahedron>();\r\n triCircle3S = new ArrayList<Tetrahedron>();\r\n\r\n sw1 = new ArrayList<SinWave>();\r\n sw2 = new ArrayList<SinWave>();\r\n tw = new ArrayList<TanWave>();\r\n cw1 = new ArrayList<CosWave>();\r\n\r\n sw1b = new ArrayList<SinWave>();\r\n sw2b = new ArrayList<SinWave>();\r\n twb = new ArrayList<TanWave>();\r\n cw1b = new ArrayList<CosWave>();\r\n\r\n sw1c = new ArrayList<SinWave>();\r\n sw2c = new ArrayList<SinWave>();\r\n twc = new ArrayList<TanWave>();\r\n cw1c = new ArrayList<CosWave>();\r\n\r\n \/\/first circle\r\n for(int i=0; i<circleNum; i++){\r\n Tetrahedron t = new Tetrahedron(color((i)*(100\/circleNum), 100, 100));\r\n\r\n SinWave x = new SinWave(radians(360\/circleNum*i), frequency, amplitude, offset);\r\n sw1.add(x);\r\n SinWave y = new SinWave(PI\/2+radians(360\/circleNum*i), frequency, amplitude, offset);\r\n sw2.add(y);\r\n TanWave tt = new TanWave(radians(360\/(circleNum*2)*i), frequency, amplitude, offset);\r\n tw.add(tt);\r\n CosWave v = new CosWave(radians(180\/2*i), 0.1, 0.2, offset);\r\n cw1.add(v);\r\n\r\n t.update(x.run()*100, v.run()*50, y.run()*100, tt.run()*0.05);\r\n triCircleS.add(t);\r\n }\r\n\r\n \/\/spread circle\r\n int amount = 30;\r\n for(int j=0; j<amount; j++){\r\n Tetrahedron tet = new Tetrahedron();\r\n Tetrahedron t = new Tetrahedron();\r\n\r\n SinWave x2 = new SinWave(radians(360\/amount*j), frequency, amplitude, offset);\r\n sw1b.add(x2);\r\n SinWave y2 = new SinWave(PI\/2+radians(360\/amount*j), frequency, amplitude, offset);\r\n sw2b.add(y2);\r\n TanWave tt2 = new TanWave(radians(360\/(amount*2)*j), frequency, amplitude, offset);\r\n twb.add(tt2);\r\n CosWave v2 = new CosWave(radians(180\/2*j), 0.1, 0.2, offset);\r\n cw1b.add(v2);\r\n\r\n SinWave x3 = new SinWave(radians(360\/amount*j), frequency, amplitude, offset);\r\n sw1c.add(x3);\r\n SinWave y3 = new SinWave(PI\/2+radians(360\/amount*j), frequency, amplitude, offset);\r\n sw2c.add(y3);\r\n TanWave tt3 = new TanWave(radians(360\/(amount*2)*j), frequency, amplitude, offset);\r\n twc.add(tt3);\r\n CosWave v3 = new CosWave(PI\/2+radians(180\/2*j), frequency, amplitude, 0);\r\n cw1c.add(v3);\r\n\r\n tet.update(x2.run()*100, v2.run()*50, y2.run()*100, tt2.run()*0.05);\r\n\r\n t.update(x3.run()*100, v3.run()*50, v3.run()*100, tt3.run()*0.05);\r\n\r\n triCircle2S.add(tet);\r\n triCircle3S.add(t);\r\n }\r\n\r\n size=2;\r\n\r\n}\r\n\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ DRAW \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\nvoid draw() {\r\n rotateX(-.2);\r\n \/\/rotateY(-.2);\r\n\r\n background(255\/23);\r\n \/\/lights();\r\n noFill();\r\n \/\/stroke(255);\r\n \/\/strokeWeight(3);\r\n\r\n \/\/Camera-------------------------------------------------\r\n \/\/-------------------------------------------------------\r\n\/\/ if(frameCount < 60*20)\r\n\/\/ cam.setYawRotationMode();\r\n\r\n \/\/rotateX(-PI\/2);\r\n noiseDetail(octaves, falloff);\r\n\r\n posX = sinW1.run();\r\n posY = cosW2.run();\r\n posZ = cosW1.run();\r\n\r\n posX2 = cosW1.run();\r\n posY2 = sinW2.run();\r\n posZ2 = cosW2.run();\r\n\r\n spin = 0.05*tanW1.run();\r\n\r\n \/\/inner circle---------------------------------------------------\r\n \/\/0:00~0:32------------------------------------------------------\r\n if(triCircleS.size()>0){ \r\n \/\/circle\r\n for(int i=0; i<triCircleS.size(); i++){\r\n Tetrahedron t = triCircleS.get(i);\r\n SinWave x = sw1.get(i);\r\n SinWave y = sw2.get(i);\r\n TanWave tt = tw.get(i);\r\n CosWave v = cw1.get(i);\r\n\r\n t.update(x.run()*(70+radiusCircle), v.run()*50, y.run()*(70+radiusCircle), tt.run()*0.05); \r\n\r\n if(frameCount > 3500) {\r\n if(frameCount < 3720)\r\n radiusCircle += 0.002;\r\n else if(frameCount < 3720+60*2)\r\n radiusCircle -= 0.002;\r\n }\r\n\r\n \/\/sizing---------------------------------------------------------\r\n \/\/0:00~0:32------------------------------------------------------\r\n if(frameCount < 900) {\r\n size += 0.00007;\r\n }\r\n else if(frameCount < 960) {\r\n size -= 0.00105;\r\n }\r\n else if(frameCount < 1860) {\r\n size += 0.0001;\r\n }\r\n else if(frameCount < 1920) {\r\n size -= 0.0015;\r\n }\r\n\r\n if(frameCount < 60*3.5)\r\n radiusCircle += 0.003;\r\n else if(frameCount < 60*8)\r\n radiusCircle -= 0.003;\r\n else if(frameCount < 60*11)\r\n radiusCircle += 0.002;\r\n else if(frameCount < 60*12)\r\n radiusCircle -= 0.003; \r\n else if(frameCount < 60*16)\r\n radiusCircle += 0.002;\r\n\r\n else if(frameCount < 60*20)\r\n radiusCircle -= 0.003;\r\n else if(frameCount < 60*24)\r\n radiusCircle += 0.002;\r\n else if(frameCount < 60*27)\r\n radiusCircle -= 0.003;\r\n else if(frameCount < 60*28)\r\n radiusCircle += 0.003; \r\n else if(frameCount < 60*32.5)\r\n radiusCircle -= 0.002;\r\n\r\n else if(frameCount < 60*36)\r\n radiusCircle += 0.003;\r\n else if(frameCount < 60*40)\r\n radiusCircle -= 0.003;\r\n else if(frameCount < 60*42)\r\n radiusCircle += 0.003;\r\n else if(frameCount < 60*44)\r\n radiusCircle -= 0.003;\r\n else if(frameCount < 60*48)\r\n radiusCircle += 0.003;\r\n\r\n \/\/Up & Down------------------------------------------------------\r\n \/\/0:46~------------------------------------------------------\r\n if(frameCount > 2800 && frameCount < 2900){ \/\/ && frameCount < 3900\r\n if(size>0)\r\n size -= 0.0005;\r\n }\r\n if(frameCount > 2900 && frameCount < 3000)\r\n size += 0.0005;\r\n\r\n if (frameCount == 2900)\r\n v.setTime(radians(180*i));\r\n if (frameCount > 2850 && frameCount < 3300) {\r\n if(v.frequency>0.06)\r\n v.frequency -= 0.001;\r\n } \r\n\r\n \/\/Up & Down_speedUp----------------------------------------------\r\n \/\/0:58~0:70------------------------------------------------------\r\n else if (frameCount > 3500 && frameCount < 4200) {\r\n v.frequency += 0.0005;\r\n }\r\n\r\n println(v.frequency);\r\n\r\n t.setSize(size);\r\n\r\n t.display();\r\n }\r\n }\r\n\r\n \/\/spread---------------------------------------------------------\r\n \/\/0:32~0:47------------------------------------------------------\r\n if(frameCount > 1920){\r\n pushStyle();\r\n if(frameCount < 4530)\r\n stroke(100*53\/359, 100, increaseBri); \r\n else {\r\n if(frameCount % 60 < 30)\r\n stroke(100*184\/359, 89, 100);\r\n else\r\n stroke(100*331\/359, 100, 100);\r\n }\r\n for(int i=0; i<triCircle2S.size(); i++){\r\n Tetrahedron tet = triCircle2S.get(i);\r\n SinWave x2 = sw1b.get(i);\r\n SinWave y2 = sw2b.get(i);\r\n TanWave tt2 = twb.get(i);\r\n CosWave v2 = cw1b.get(i);\r\n\r\n x2.setAmp(amplitude+increaseAmp);\r\n y2.setAmp(amplitude+increaseAmp);\r\n\r\n if(frameCount < 1920+60)\r\n increaseAmp +=0.0005;\r\n else if(frameCount < 1920+60*2)\r\n increaseAmp -=0.0005;\r\n else if(frameCount < 1920+60*3)\r\n increaseAmp +=0.0005;\r\n else if(frameCount < 1920+60*4)\r\n increaseAmp -=0.0005;\r\n else if(frameCount < 1920+60*5)\r\n increaseAmp +=0.0005;\r\n else if(frameCount < 1920+60*6)\r\n increaseAmp -=0.0005;\r\n else if(frameCount < 1920+60*7)\r\n increaseAmp +=0.0005;\r\n else if(frameCount < 1920+60*8)\r\n increaseAmp -=0.0005;\r\n else if(frameCount < 1920+60*9)\r\n increaseAmp +=0.0005;\r\n else if(frameCount < 1920+60*10)\r\n increaseAmp -=0.0005;\r\n else if(frameCount < 1920+60*11)\r\n increaseAmp +=0.0005;\r\n else if(frameCount < 1920+60*12)\r\n increaseAmp -=0.0005;\r\n else if(frameCount < 1920+60*13)\r\n increaseAmp +=0.0005;\r\n else if(frameCount < 1920+60*14)\r\n increaseAmp -=0.0005;\r\n\r\n if(frameCount > 60*75.5 && frameCount < 60*77.1) \/\/ && frameCount < 3900\r\n v2.amplitude -= 0.05;\r\n\r\n tet.update(x2.run()*100, v2.run()*(50+increaseAmp)+50, y2.run()*100, tt2.run()*0.05);\r\n tet.display();\r\n }\r\n popStyle();\r\n increaseBri += 0.8;\r\n }\r\n\r\n \/\/another spread-------------------------------------------------\r\n \/\/------------------------------------------------------\r\n if(frameCount > 60*61){\r\n pushStyle();\r\n\r\n stroke((int)random(100)*100\/359,100,100);\r\n\r\n for(int i=0; i<triCircle3S.size(); i++){\r\n Tetrahedron ttt = triCircle3S.get(i);\r\n ttt.setSize(1);\r\n\r\n if(frameCount < 60*70) {\r\n if(frameCount % 30 == 0){\r\n ttt.setSize(random(2));\r\n strokeWeight(random(1,5));\r\n }\r\n } else if(frameCount < 60*77) {\r\n if(frameCount % 30 == 0){\r\n ttt.setSize(random(2,5));\r\n strokeWeight(random(3,7));\r\n }\r\n }\r\n\r\n SinWave x3 = sw1c.get(i);\r\n SinWave y3 = sw2c.get(i);\r\n TanWave tt3 = twc.get(i);\r\n CosWave v3 = cw1c.get(i);\r\n\r\n ttt.update(x3.run()*100, y3.run()*50, v3.run()*100, tt3.run()*0.05);\r\n ttt.display();\r\n }\r\n popStyle();\r\n }\r\n\r\n \/\/auto create flying ones\r\n if(frameCount > 60*16 && frameCount < 60*46){\r\n if(frameCount % (60*4) < (60*1)) {\r\n if(frameCount % 10 ==0)\r\n newTri();\r\n }\r\n\r\n }\r\n\r\n if(frameCount > 60*55 && frameCount < 60*60) {\r\n octaves += 0.1;\r\n falloff += 0.007;\r\n }\r\n\r\n if(triS.size()>0){\r\n pushStyle();\r\n\r\n \/\/flying around\r\n color triC = color(50, 70, increaseBri2);\r\n\r\n int direction = 1;\r\n\r\n \/\/appear\r\n if(frameCount > 60*10) {\r\n if(increaseBri2 < 50) {\r\n increaseBri2 += 0.1*direction;\r\n\r\n }\r\n } else if (frameCount > 60*77) {\r\n if(increaseBri2 < 100) {\r\n increaseBri2 += 0.1*direction;\r\n\r\n }\r\n }\r\n\r\n for(int i=0; i<triS.size(); i++){\r\n Tetrahedron t = triS.get(i);\r\n\r\n if(frameCount < 60*61)\r\n t.setSize(size\/2);\r\n else if(frameCount < 60*70) {\r\n if(frameCount % 30 == 15){\r\n t.setSize(random(2));\r\n strokeWeight(random(1,5));\r\n }\r\n } else if(frameCount < 60*77) {\r\n if(frameCount % 30 == 15){\r\n t.setSize(random(2,5));\r\n strokeWeight(random(3,7));\r\n }\r\n triC = color(random(1,100), 70, increaseBri2);\r\n\r\n } else if(frameCount < 60*86) {\r\n t.setSize(random(2));\r\n triC = color(random(1,100), 70, increaseBri2);\r\n } else {\r\n t.setSize(random(100,500));\r\n triC = color(random(1,100), 70, 100);\r\n }\r\n\r\n t.setAngle(radians(i*10));\r\n\r\n if(i%2 == 0)\r\n t.update(t.x+posX, t.y+posY, t.z+(noise(time)*posZ), spin);\r\n else\r\n t.update(t.x+posX2, t.y+posY2, t.z+(noise(time)*posZ2), spin);\r\n\r\n t.display( triC ); \r\n } \r\n popStyle();\r\n }\r\n}\r\n\r\nvoid newTri(){\r\n\r\n Tetrahedron t = new Tetrahedron();\r\n triS.add(t);\r\n}\r\n\r\nvoid mousePressed(){\r\n\r\n newTri();\r\n}\r\n\r\nvoid keyPressed() {\r\n\r\n switch(keyCode) {\r\n case UP:\r\n octaves++;\r\n break;\r\n case DOWN:\r\n octaves--;\r\n break;\r\n case RIGHT:\r\n falloff+=.1;\r\n break;\r\n case LEFT:\r\n falloff-=.1;\r\n break;\r\n }\r\n\r\n octaves = constrain(octaves, 0, 25);\r\n falloff = constrain(falloff, 0.0, 1.1);\r\n}<\/pre>\nclass Tetrahedron {\r\n\r\n PShape t;\r\n PShape t1, t2, t3, t4;\r\n\r\n float x, y, z;\r\n float scale = 5;\r\n float angleY;\r\n\r\n color c;\r\n\r\n Tetrahedron() {\r\n \/\/c = color(0,0,100);\r\n\r\n t = createShape(GROUP);\r\n\r\n t1 = createShape();\r\n t1.beginShape();\r\n t1.stroke(c);\r\n t1.vertex(-3, 0, 0);\r\n t1.vertex(3, 0, 0);\r\n t1.vertex(0, 0, -4);\r\n t1.endShape(CLOSE);\r\n\r\n t2 = createShape();\r\n t2.beginShape();\r\n t2.stroke(c);\r\n t2.vertex(-3, 0, 0);\r\n t2.vertex(0, 4, -1.7);\r\n t2.vertex(3, 0, 0);\r\n t2.endShape(CLOSE);\r\n\r\n t3 = createShape();\r\n t3.beginShape();\r\n t3.stroke(c);\r\n t3.vertex(3, 0, 0);\r\n t3.vertex(0, 4, -1.7);\r\n t3.vertex(0, 0, -4);\r\n t3.endShape(CLOSE);\r\n\r\n t4 = createShape();\r\n t4.beginShape();\r\n t4.stroke(c);\r\n t4.vertex(-3, 0, 0);\r\n t4.vertex(0, 0, -4);\r\n t4.vertex(0, 4, -1.7);\r\n t4.endShape(CLOSE);\r\n\r\n t.addChild(t1);\r\n t.addChild(t2);\r\n t.addChild(t3);\r\n t.addChild(t4);\r\n\r\n x = random(-200, 200);\r\n y = random(-200, 200);\r\n z = random(-200,200);\r\n\r\n t.disableStyle();\r\n t1.disableStyle();\r\n t2.disableStyle();\r\n t3.disableStyle();\r\n t4.disableStyle();\r\n }\r\n\r\n Tetrahedron(color _c) {\r\n c = _c;\r\n\r\n t = createShape(GROUP);\r\n\r\n t1 = createShape();\r\n t1.beginShape();\r\n t1.stroke(c);\r\n t1.vertex(-3, 0, 0);\r\n t1.vertex(3, 0, 0);\r\n t1.vertex(0, 0, -4);\r\n t1.endShape(CLOSE);\r\n\r\n t2 = createShape();\r\n t2.beginShape();\r\n t2.stroke(c);\r\n t2.vertex(-3, 0, 0);\r\n t2.vertex(0, 4, -1.7);\r\n t2.vertex(3, 0, 0);\r\n t2.endShape(CLOSE);\r\n\r\n t3 = createShape();\r\n t3.beginShape();\r\n t3.stroke(c);\r\n t3.vertex(3, 0, 0);\r\n t3.vertex(0, 4, -1.7);\r\n t3.vertex(0, 0, -4);\r\n t3.endShape(CLOSE);\r\n\r\n t4 = createShape();\r\n t4.beginShape();\r\n t4.stroke(c);\r\n t4.vertex(-3, 0, 0);\r\n t4.vertex(0, 0, -4);\r\n t4.vertex(0, 4, -1.7);\r\n t4.endShape(CLOSE);\r\n\r\n t.addChild(t1);\r\n t.addChild(t2);\r\n t.addChild(t3);\r\n t.addChild(t4);\r\n\r\n x = random(-200, 200);\r\n y = random(-200, 200);\r\n z = random(-200,200);\r\n\r\n }\r\n\r\n void update(float _x, float _y, float _z) {\r\n x = _x;\r\n y = _y;\r\n z = _z;\r\n }\r\n\r\n void update(float _x, float _y, float _z, float _angleY) {\r\n x = _x;\r\n y = _y;\r\n z = _z;\r\n angleY = _angleY;\r\n }\r\n\r\n void update(float _x, float _y, float _z, color _c) {\r\n x = _x;\r\n y = _y;\r\n z = _z;\r\n c = _c;\r\n }\r\n\r\n void update(float _x, float _y, float _z, color _c, float _angleY) {\r\n x = _x;\r\n y = _y;\r\n z = _z;\r\n c = _c;\r\n angleY = _angleY;\r\n }\r\n\r\n void setZ(float _z) {\r\n z = _z;\r\n }\r\n\r\n void setAngle(float _angleY) {\r\n angleY = _angleY;\r\n }\r\n\r\n void setSize(float _scale) {\r\n scale = _scale;\r\n }\r\n\r\n void display() {\r\n pushMatrix(); \r\n\r\n translate(x, y, z);\r\n rotateY(angleY);\r\n rotateZ(angleY);\r\n scale(scale);\r\n\r\n shape(t);\r\n popMatrix();\r\n }\r\n\r\n void display(color _color) {\r\n pushMatrix(); \r\n pushStyle();\r\n\r\n fill(_color);\r\n noStroke();\r\n\r\n translate(x, y, z);\r\n rotateY(angleY);\r\n rotateZ(angleY);\r\n scale(scale);\r\n\r\n shape(t);\r\n\r\n popStyle();\r\n popMatrix();\r\n }\r\n}\r\n\r\nclass Wave{\r\n\r\n float time, frequency, amplitude, offset;\r\n\r\n Wave(float _time, float _frequency, float _amplitude, float _offset){\r\n time = _time;\r\n frequency = _frequency;\r\n amplitude = _amplitude;\r\n offset = _offset;\r\n }\r\n\r\n float run(){\r\n time += frequency;\r\n return sin( time ) * amplitude + offset;\r\n }\r\n\r\n void setAmp(float _amp){\r\n amplitude = _amp;\r\n }\r\n\r\n void setTime(float _ti){\r\n time = _ti;\r\n }\r\n\r\n}\r\n\r\nclass SinWave {\r\n float time, frequency, amplitude, offset;\r\n\r\n SinWave(float _time, float _frequency, float _amplitude, float _offset){\r\n time = _time;\r\n frequency = _frequency;\r\n amplitude = _amplitude;\r\n offset = _offset;\r\n }\r\n\r\n float run() {\r\n time += frequency;\r\n return sin( time ) * amplitude + offset;\r\n }\r\n\r\n void setAmp(float _amp){\r\n amplitude = _amp;\r\n }\r\n\r\n void setTime(float _ti){\r\n time = _ti;\r\n }\r\n}\r\n\r\nclass CosWave{\r\n float time, frequency, amplitude, offset;\r\n\r\n CosWave(float _time, float _frequency, float _amplitude, float _offset){\r\n time = _time;\r\n frequency = _frequency;\r\n amplitude = _amplitude;\r\n offset = _offset;\r\n }\r\n\r\n float run() {\r\n time += frequency;\r\n return cos( time ) * amplitude + offset;\r\n }\r\n\r\n void setAmp(float _amp){\r\n amplitude = _amp;\r\n }\r\n\r\n void setTime(float _ti){\r\n time = _ti;\r\n }\r\n\r\n}\r\n\r\nclass TanWave {\r\n float time, frequency, amplitude, offset;\r\n\r\n TanWave(float _time, float _frequency, float _amplitude, float _offset){\r\n time = _time;\r\n frequency = _frequency;\r\n amplitude = _amplitude;\r\n offset = _offset;\r\n }\r\n\r\n float run() {\r\n time += frequency;\r\n return tan( time ) * amplitude + offset;\r\n }\r\n\r\n void setAmp(float _amp){\r\n amplitude = _amp;\r\n }\r\n\r\n void setTime(float _ti){\r\n time = _ti;\r\n }\r\n\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"For this week’s subject Timing and Pacing, I chose “No Safe-House” in the soundtrack of The Grand Budapest Hotel to decode. effect I intend to achieve –> emotion accumulation,… Read The Rest →<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[127,118,116],"tags":[178,179,22,24],"_links":{"self":[{"href":"http:\/\/www.jhclaura.com\/wp-json\/wp\/v2\/posts\/1338"}],"collection":[{"href":"http:\/\/www.jhclaura.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.jhclaura.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.jhclaura.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.jhclaura.com\/wp-json\/wp\/v2\/comments?post=1338"}],"version-history":[{"count":9,"href":"http:\/\/www.jhclaura.com\/wp-json\/wp\/v2\/posts\/1338\/revisions"}],"predecessor-version":[{"id":1363,"href":"http:\/\/www.jhclaura.com\/wp-json\/wp\/v2\/posts\/1338\/revisions\/1363"}],"wp:attachment":[{"href":"http:\/\/www.jhclaura.com\/wp-json\/wp\/v2\/media?parent=1338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.jhclaura.com\/wp-json\/wp\/v2\/categories?post=1338"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.jhclaura.com\/wp-json\/wp\/v2\/tags?post=1338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}