From 9001829878231a6b933ab55b2e34c9c06891b16a Mon Sep 17 00:00:00 2001 From: shiffman Date: Tue, 22 May 2012 10:53:55 +0000 Subject: [PATCH] PShape example updates --- .../Create Shapes/BeginEndContour/BeginEndContour.pde | 8 +++++--- .../Topics/Create Shapes/GroupPShape/GroupPShape.pde | 6 +++--- .../ParticleSystemPShape/ParticleSystemPShape.pde | 2 +- .../Topics/Create Shapes/PathPShape/PathPShape.pde | 2 +- .../Topics/Create Shapes/PolygonPShape/PolygonPShape.pde | 2 +- .../Create Shapes/PolygonPShapeOOP2/PolygonPShapeOOP2.pde | 4 ++-- .../Create Shapes/PrimitivePShape/PrimitivePShape.pde | 2 +- .../Topics/Create Shapes/WigglePShape/Wiggler.pde | 2 +- 8 files changed, 15 insertions(+), 13 deletions(-) diff --git a/java/examples/Topics/Create Shapes/BeginEndContour/BeginEndContour.pde b/java/examples/Topics/Create Shapes/BeginEndContour/BeginEndContour.pde index 899089957..e4239f47a 100644 --- a/java/examples/Topics/Create Shapes/BeginEndContour/BeginEndContour.pde +++ b/java/examples/Topics/Create Shapes/BeginEndContour/BeginEndContour.pde @@ -7,7 +7,7 @@ PShape s; void setup() { - size(640, 360, P3D); + size(640, 360, P3D); // Not working in P2D? smooth(); // Make a shape s = createShape(); @@ -18,7 +18,8 @@ void setup() { s.vertex(-100,-100); s.vertex(100,-100); s.vertex(100,100); - s.vertex(100,-100); + s.vertex(-100,100); + s.vertex(-100,-100); s.endContour(); // Interior part of shape @@ -26,7 +27,8 @@ void setup() { s.vertex(-10,-10); s.vertex(10,-10); s.vertex(10,10); - s.vertex(10,-10); + s.vertex(-10,10); + s.vertex(-10,-10); s.endContour(); // Finishing off shape diff --git a/java/examples/Topics/Create Shapes/GroupPShape/GroupPShape.pde b/java/examples/Topics/Create Shapes/GroupPShape/GroupPShape.pde index d794b1eac..0fc05e2d9 100644 --- a/java/examples/Topics/Create Shapes/GroupPShape/GroupPShape.pde +++ b/java/examples/Topics/Create Shapes/GroupPShape/GroupPShape.pde @@ -9,14 +9,14 @@ PShape group; void setup() { - size(640, 360, P2D); + size(640, 360, P3D); smooth(); // Create the shape as a group group = createShape(GROUP); // Make a polygon PShape PShape star = createShape(); - star.fill(102); + star.noFill(); star.stroke(255); star.vertex(0, -50); star.vertex(14, -20); @@ -49,7 +49,7 @@ void setup() { // Add them all to the group group.addChild(star); group.addChild(path); - group.addChild(rectangle); + group.addChild(rectangle); // Rectangle is missing??? } diff --git a/java/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystemPShape.pde b/java/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystemPShape.pde index c9cc73f99..71ee39b74 100644 --- a/java/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystemPShape.pde +++ b/java/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystemPShape.pde @@ -10,7 +10,7 @@ ParticleSystem ps; PImage sprite; void setup() { - size(640, 360, P3D); + size(640, 360, P2D); // Load the image sprite = loadImage("sprite.png"); // A new particle system with 10,000 particles diff --git a/java/examples/Topics/Create Shapes/PathPShape/PathPShape.pde b/java/examples/Topics/Create Shapes/PathPShape/PathPShape.pde index ab3d81f03..dd76c39e5 100644 --- a/java/examples/Topics/Create Shapes/PathPShape/PathPShape.pde +++ b/java/examples/Topics/Create Shapes/PathPShape/PathPShape.pde @@ -8,7 +8,7 @@ PShape path; void setup() { - size(640, 360, P3D); + size(640, 360, P2D); smooth(); // Create the shape path = createShape(); diff --git a/java/examples/Topics/Create Shapes/PolygonPShape/PolygonPShape.pde b/java/examples/Topics/Create Shapes/PolygonPShape/PolygonPShape.pde index 3f3e39a3e..55a093595 100644 --- a/java/examples/Topics/Create Shapes/PolygonPShape/PolygonPShape.pde +++ b/java/examples/Topics/Create Shapes/PolygonPShape/PolygonPShape.pde @@ -9,7 +9,7 @@ PShape star; void setup() { - size(640, 360,P3D); + size(640, 360,P2D); smooth(); // First create the shape star = createShape(); diff --git a/java/examples/Topics/Create Shapes/PolygonPShapeOOP2/PolygonPShapeOOP2.pde b/java/examples/Topics/Create Shapes/PolygonPShapeOOP2/PolygonPShapeOOP2.pde index e066ee49d..723da5c64 100644 --- a/java/examples/Topics/Create Shapes/PolygonPShapeOOP2/PolygonPShapeOOP2.pde +++ b/java/examples/Topics/Create Shapes/PolygonPShapeOOP2/PolygonPShapeOOP2.pde @@ -11,10 +11,10 @@ ArrayList polygons; void setup() { - size(640, 360, P3D); + size(640, 360, P2D); smooth(); // Make a PShape - PShape star = createShape(POLYGON); + PShape star = createShape(); star.fill(0,127); star.stroke(0); star.vertex(0, -50); diff --git a/java/examples/Topics/Create Shapes/PrimitivePShape/PrimitivePShape.pde b/java/examples/Topics/Create Shapes/PrimitivePShape/PrimitivePShape.pde index f51e53a75..bfc0ce4f9 100644 --- a/java/examples/Topics/Create Shapes/PrimitivePShape/PrimitivePShape.pde +++ b/java/examples/Topics/Create Shapes/PrimitivePShape/PrimitivePShape.pde @@ -19,7 +19,7 @@ void setup() { void draw() { background(51); // We can dynamically set the stroke and fill of the shape - circle.stroke(255); + circle.stroke(255); // Not working in P2D?? circle.fill(map(mouseX,0,width,0,255)); // We can use translate to move the PShape translate(mouseX, mouseY); diff --git a/java/examples/Topics/Create Shapes/WigglePShape/Wiggler.pde b/java/examples/Topics/Create Shapes/WigglePShape/Wiggler.pde index f1dc7725c..d8971aca1 100644 --- a/java/examples/Topics/Create Shapes/WigglePShape/Wiggler.pde +++ b/java/examples/Topics/Create Shapes/WigglePShape/Wiggler.pde @@ -47,7 +47,7 @@ class Wiggler { r.mult(4); r.add(pos); // Set the location of each vertex to the new one - s.setVertex(i, r.x, r.y, r.z); + s.setVertex(i, r.x, r.y); // increment perlin noise x value xoff+= 0.5; }