Last active
December 21, 2016 11:34
-
-
Save jeonghopark/e37835b40194ab2015d6f03e3ccdb466 to your computer and use it in GitHub Desktop.
Revisions
-
jeonghopark revised this gist
Dec 21, 2016 . 1 changed file with 4 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,15 +14,15 @@ FloatList movingV = new FloatList(); void setup() { size(800, 500, P3D); camera = new PeasyCam(this, 400); meshStrip = createShape(); for (int i=0; i<meshNUM; i++) { meshPos.add(new PVector( i * xStep, 0, 0) ); } meshStrip.beginShape(TRIANGLE_STRIP); meshStrip.stroke(0, 40); for (int i=0; i<meshPos.size(); i++) { @@ -37,7 +37,6 @@ void setup() { void draw() { background(120); for (int i=0; i<meshStrip.getVertexCount(); i+=1) { movingV.set(i, sin(radians(i * 360.0/meshStrip.getVertexCount() + frameCount * 2)) * 30); PVector _v = new PVector(meshStrip.getVertex(i).x, meshStrip.getVertex(i).y, movingV.get(i)); @@ -48,6 +47,4 @@ void draw() { shape(meshStrip, 0, 0); } -
jeonghopark revised this gist
Dec 21, 2016 . 1 changed file with 23 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,7 @@ import peasy.*; PeasyCam camera; ArrayList<PVector> meshPos = new ArrayList(); float xStep = 20; @@ -6,27 +10,44 @@ int meshNUM = 20; PShape meshStrip; FloatList movingV = new FloatList(); void setup() { size(800, 500, P3D); camera = new PeasyCam(this, 400); meshStrip = createShape(); for (int i=0; i<meshNUM; i++) { meshPos.add(new PVector( i * xStep, 0, 0) ); } meshStrip.beginShape(TRIANGLE_STRIP); meshStrip.stroke(0, 40); for (int i=0; i<meshPos.size(); i++) { meshStrip.vertex(meshPos.get(i).x, meshPos.get(i).y, meshPos.get(i).z); meshStrip.vertex(meshPos.get(i).x, meshPos.get(i).y + yStep, meshPos.get(i).z); } meshStrip.endShape(CLOSE); } void draw() { background(120); for (int i=0; i<meshStrip.getVertexCount(); i+=1) { movingV.set(i, sin(radians(i * 360.0/meshStrip.getVertexCount() + frameCount * 2)) * 30); PVector _v = new PVector(meshStrip.getVertex(i).x, meshStrip.getVertex(i).y, movingV.get(i)); meshStrip.setVertex(i, _v); } translate(-xStep * meshNUM * 0.5, 0); shape(meshStrip, 0, 0); } -
jeonghopark revised this gist
Dec 21, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -27,5 +27,6 @@ void setup() { void draw() { background(120); translate(width * 0.5 - xStep * meshNUM * 0.5, height * 0.5); shape(meshStrip, 0, 0); } -
jeonghopark revised this gist
Dec 21, 2016 . 1 changed file with 16 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,23 +4,28 @@ float xStep = 20; float yStep = 20; int meshNUM = 20; PShape meshStrip; void setup() { size(800, 500, P3D); meshStrip = createShape(); for (int i=0; i<meshNUM; i++) { meshPos.add(new PVector( i * xStep, 0, 0) ); } meshStrip.beginShape(TRIANGLE_STRIP); for (int i=0; i<meshPos.size(); i++) { meshStrip.vertex(meshPos.get(i).x, meshPos.get(i).y, meshPos.get(i).z); meshStrip.vertex(meshPos.get(i).x, meshPos.get(i).y + yStep, meshPos.get(i).z); } meshStrip.endShape(CLOSE); } void draw() { background(120); shape(meshStrip, 0, 0); } -
jeonghopark revised this gist
Dec 21, 2016 . 1 changed file with 7 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,14 @@ ArrayList<PVector> meshPos = new ArrayList(); float xStep = 20; float yStep = 20; int meshNUM = 20; void setup() { size(800, 500, P3D); for (int i=0; i<meshNUM; i++) { meshPos.add(new PVector( i * xStep, 0, 0) ); } } @@ -15,7 +19,7 @@ void draw() { beginShape(TRIANGLE_STRIP); for (int i=0; i<meshPos.size(); i++) { vertex(meshPos.get(i).x, meshPos.get(i).y, meshPos.get(i).z); vertex(meshPos.get(i).x, meshPos.get(i).y + yStep, meshPos.get(i).z); } endShape(CLOSE); -
jeonghopark created this gist
Dec 21, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ ArrayList<PVector> meshPos = new ArrayList(); void setup() { size(800, 500, P3D); for (int i=0; i<20; i++) { meshPos.add(new PVector( i * 10, 0, 0) ); } } void draw() { background(120); beginShape(TRIANGLE_STRIP); for (int i=0; i<meshPos.size(); i++) { vertex(meshPos.get(i).x, meshPos.get(i).y, meshPos.get(i).z); vertex(meshPos.get(i).x, meshPos.get(i).y + 20, meshPos.get(i).z); } endShape(CLOSE); }