From 321d31dcf918b5f79bf6cc6ca46b1954eb135bec Mon Sep 17 00:00:00 2001 From: Ricard Date: Fri, 2 Dec 2011 22:09:23 +0100 Subject: [PATCH] update the examples --- .../Tutorial_05_HelloWorld_rotate_firstletter.pde | 13 +++---------- .../Tutorial_07_HelloWorld_getPoints.pde | 1 - .../Tutorial_09_HelloBot_svgToGroup.pde | 2 -- .../Tutorial_10_HelloPolygonize.pde | 2 -- .../Tutorial_11_HelloBot_ignoreStyles.pde | 2 -- .../Tutorial_12_HelloSplitting.pde | 2 -- .../Tutorial_13_HelloSplittingShapes.pde | 2 -- .../Tutorial_14_HelloSplitAll.pde | 3 --- .../Tutorial_15_HelloSplitGroups.pde | 2 -- .../Tutorial_16_HelloSVGtoPDF.pde | 1 - .../Tutorial_18_HelloTangents.pde | 3 --- .../Tutorial_19_HelloAdapt.pde | 2 -- .../Tutorial_19b_HelloAdaptChildren.pde | 1 - .../Tutorial_20_InsertHandle.pde | 3 --- .../Tutorial_21_InsertHandleGroup.pde | 3 --- .../Tutorial_22_GetPointPaths.pde | 1 - .../Tutorial_23_Contains/Tutorial_23_Contains.pde | 3 --- .../Tutorial_24_Intersection.pde | 2 -- .../Tutorial_25_Closest/Tutorial_25_Closest.pde | 2 -- .../Tutorial_25_Closest_commands.pde | 2 -- 20 files changed, 3 insertions(+), 49 deletions(-) diff --git a/examples/Tutorial_05_HelloWorld_rotate_firstletter/Tutorial_05_HelloWorld_rotate_firstletter.pde b/examples/Tutorial_05_HelloWorld_rotate_firstletter/Tutorial_05_HelloWorld_rotate_firstletter.pde index a923bc5..a3a1f14 100644 --- a/examples/Tutorial_05_HelloWorld_rotate_firstletter/Tutorial_05_HelloWorld_rotate_firstletter.pde +++ b/examples/Tutorial_05_HelloWorld_rotate_firstletter/Tutorial_05_HelloWorld_rotate_firstletter.pde @@ -1,10 +1,8 @@ import geomerative.*; -import processing.opengl.*; // Declare the objects we are going to use, so that they are accesible from setup() and from draw() RFont f; RShape grp; -RMatrix mat; void setup(){ // Initilaize the sketch @@ -24,12 +22,6 @@ void setup(){ // Enable smoothing smooth(); - - // Define a rotation of PI/20 around the center of the first letter - mat = new RMatrix(); - // To get the center of the first letter we must access the first element on the group - RPoint centerOfFirstLetter = grp.children[0].getCenter(); - mat.rotate(PI/20,centerOfFirstLetter); } void draw(){ @@ -39,8 +31,9 @@ void draw(){ // Set the origin to draw in the middle of the sketch translate(width/2, height/2); - // Transform at each frame the first letter with the transformation we defined before - grp.children[0].transform(mat); + // Transform at each frame the first letter with a PI/20 radians + // rotation around the center of the first letter's center + grp.children[0].rotate(PI/20, grp.children[0].getCenter()); // Draw the group of shapes representing "Hola mundo!" on the PGraphics canvas g (which is the default canvas of the sketch) grp.draw(); diff --git a/examples/Tutorial_07_HelloWorld_getPoints/Tutorial_07_HelloWorld_getPoints.pde b/examples/Tutorial_07_HelloWorld_getPoints/Tutorial_07_HelloWorld_getPoints.pde index 712248a..b8fef5d 100644 --- a/examples/Tutorial_07_HelloWorld_getPoints/Tutorial_07_HelloWorld_getPoints.pde +++ b/examples/Tutorial_07_HelloWorld_getPoints/Tutorial_07_HelloWorld_getPoints.pde @@ -1,5 +1,4 @@ import geomerative.*; -import processing.opengl.*; // Declare the objects we are going to use, so that they are accesible from setup() and from draw() RFont f; diff --git a/examples/Tutorial_09_HelloBot_svgToGroup/Tutorial_09_HelloBot_svgToGroup.pde b/examples/Tutorial_09_HelloBot_svgToGroup/Tutorial_09_HelloBot_svgToGroup.pde index ebdab1b..e49a357 100644 --- a/examples/Tutorial_09_HelloBot_svgToGroup/Tutorial_09_HelloBot_svgToGroup.pde +++ b/examples/Tutorial_09_HelloBot_svgToGroup/Tutorial_09_HelloBot_svgToGroup.pde @@ -1,5 +1,3 @@ -import processing.xml.*; -import processing.opengl.*; import geomerative.*; RShape shp; diff --git a/examples/Tutorial_10_HelloPolygonize/Tutorial_10_HelloPolygonize.pde b/examples/Tutorial_10_HelloPolygonize/Tutorial_10_HelloPolygonize.pde index 0be7b42..ec5e906 100644 --- a/examples/Tutorial_10_HelloPolygonize/Tutorial_10_HelloPolygonize.pde +++ b/examples/Tutorial_10_HelloPolygonize/Tutorial_10_HelloPolygonize.pde @@ -1,5 +1,3 @@ -import processing.xml.*; -import processing.opengl.*; import geomerative.*; RShape shp; diff --git a/examples/Tutorial_11_HelloBot_ignoreStyles/Tutorial_11_HelloBot_ignoreStyles.pde b/examples/Tutorial_11_HelloBot_ignoreStyles/Tutorial_11_HelloBot_ignoreStyles.pde index 0200189..3344431 100644 --- a/examples/Tutorial_11_HelloBot_ignoreStyles/Tutorial_11_HelloBot_ignoreStyles.pde +++ b/examples/Tutorial_11_HelloBot_ignoreStyles/Tutorial_11_HelloBot_ignoreStyles.pde @@ -1,5 +1,3 @@ -import processing.xml.*; -import processing.opengl.*; import geomerative.*; RShape grp; diff --git a/examples/Tutorial_12_HelloSplitting/Tutorial_12_HelloSplitting.pde b/examples/Tutorial_12_HelloSplitting/Tutorial_12_HelloSplitting.pde index d0075e2..a53cc63 100644 --- a/examples/Tutorial_12_HelloSplitting/Tutorial_12_HelloSplitting.pde +++ b/examples/Tutorial_12_HelloSplitting/Tutorial_12_HelloSplitting.pde @@ -1,4 +1,3 @@ -import processing.opengl.*; import geomerative.*; RCommand curva = new RCommand(0 , 0, -200, -200, 200, -200, 0, -100); @@ -7,7 +6,6 @@ RCommand[] piezas = new RCommand[2]; void setup(){ size(600, 600); smooth(); - g.smooth = true; RG.init(this); diff --git a/examples/Tutorial_13_HelloSplittingShapes/Tutorial_13_HelloSplittingShapes.pde b/examples/Tutorial_13_HelloSplittingShapes/Tutorial_13_HelloSplittingShapes.pde index 63a62d2..e4e434d 100644 --- a/examples/Tutorial_13_HelloSplittingShapes/Tutorial_13_HelloSplittingShapes.pde +++ b/examples/Tutorial_13_HelloSplittingShapes/Tutorial_13_HelloSplittingShapes.pde @@ -1,4 +1,3 @@ -import processing.opengl.*; import geomerative.*; RShape shp; @@ -8,7 +7,6 @@ int first = 0; void setup(){ size(600, 600); smooth(); - g.smooth = true; // VERY IMPORTANT: Allways initialize the library before using it RG.init(this); diff --git a/examples/Tutorial_14_HelloSplitAll/Tutorial_14_HelloSplitAll.pde b/examples/Tutorial_14_HelloSplitAll/Tutorial_14_HelloSplitAll.pde index 606f8f3..21761bd 100644 --- a/examples/Tutorial_14_HelloSplitAll/Tutorial_14_HelloSplitAll.pde +++ b/examples/Tutorial_14_HelloSplitAll/Tutorial_14_HelloSplitAll.pde @@ -1,5 +1,3 @@ -import processing.xml.*; -import processing.opengl.*; import geomerative.*; RShape grp; @@ -9,7 +7,6 @@ int first = 0; void setup(){ size(600, 600); smooth(); - g.smooth = true; // VERY IMPORTANT: Allways initialize the library before using it RG.init(this); diff --git a/examples/Tutorial_15_HelloSplitGroups/Tutorial_15_HelloSplitGroups.pde b/examples/Tutorial_15_HelloSplitGroups/Tutorial_15_HelloSplitGroups.pde index a04c178..9a18d38 100644 --- a/examples/Tutorial_15_HelloSplitGroups/Tutorial_15_HelloSplitGroups.pde +++ b/examples/Tutorial_15_HelloSplitGroups/Tutorial_15_HelloSplitGroups.pde @@ -1,5 +1,3 @@ -import processing.xml.*; -import processing.opengl.*; import geomerative.*; RShape grp; diff --git a/examples/Tutorial_16_HelloSVGtoPDF/Tutorial_16_HelloSVGtoPDF.pde b/examples/Tutorial_16_HelloSVGtoPDF/Tutorial_16_HelloSVGtoPDF.pde index e57b24b..45cd7ba 100644 --- a/examples/Tutorial_16_HelloSVGtoPDF/Tutorial_16_HelloSVGtoPDF.pde +++ b/examples/Tutorial_16_HelloSVGtoPDF/Tutorial_16_HelloSVGtoPDF.pde @@ -1,4 +1,3 @@ -import processing.opengl.*; import processing.pdf.*; import geomerative.*; diff --git a/examples/Tutorial_18_HelloTangents/Tutorial_18_HelloTangents.pde b/examples/Tutorial_18_HelloTangents/Tutorial_18_HelloTangents.pde index 882e877..c3ac81d 100644 --- a/examples/Tutorial_18_HelloTangents/Tutorial_18_HelloTangents.pde +++ b/examples/Tutorial_18_HelloTangents/Tutorial_18_HelloTangents.pde @@ -1,5 +1,3 @@ -import processing.xml.*; -import processing.opengl.*; import geomerative.*; RShape shp; @@ -13,7 +11,6 @@ int numPoints = 500; void setup(){ size(600, 600); smooth(); - g.smooth = true; // VERY IMPORTANT: Allways initialize the library before using it RG.init(this); diff --git a/examples/Tutorial_19_HelloAdapt/Tutorial_19_HelloAdapt.pde b/examples/Tutorial_19_HelloAdapt/Tutorial_19_HelloAdapt.pde index 591a16c..8412d02 100644 --- a/examples/Tutorial_19_HelloAdapt/Tutorial_19_HelloAdapt.pde +++ b/examples/Tutorial_19_HelloAdapt/Tutorial_19_HelloAdapt.pde @@ -1,5 +1,3 @@ -import processing.xml.*; -import processing.opengl.*; import geomerative.*; RShape grp; diff --git a/examples/Tutorial_19b_HelloAdaptChildren/Tutorial_19b_HelloAdaptChildren.pde b/examples/Tutorial_19b_HelloAdaptChildren/Tutorial_19b_HelloAdaptChildren.pde index 6a01686..b4cbe1d 100644 --- a/examples/Tutorial_19b_HelloAdaptChildren/Tutorial_19b_HelloAdaptChildren.pde +++ b/examples/Tutorial_19b_HelloAdaptChildren/Tutorial_19b_HelloAdaptChildren.pde @@ -1,4 +1,3 @@ -import processing.xml.*; import geomerative.*; RShape grp; diff --git a/examples/Tutorial_20_InsertHandle/Tutorial_20_InsertHandle.pde b/examples/Tutorial_20_InsertHandle/Tutorial_20_InsertHandle.pde index 39779d1..7d335f7 100644 --- a/examples/Tutorial_20_InsertHandle/Tutorial_20_InsertHandle.pde +++ b/examples/Tutorial_20_InsertHandle/Tutorial_20_InsertHandle.pde @@ -1,5 +1,3 @@ -import processing.xml.*; -import processing.opengl.*; import geomerative.*; RShape shp; @@ -10,7 +8,6 @@ boolean ignoringStyles = false; void setup(){ size(600, 600); smooth(); - g.smooth = true; // VERY IMPORTANT: Allways initialize the library before using it RG.init(this); diff --git a/examples/Tutorial_21_InsertHandleGroup/Tutorial_21_InsertHandleGroup.pde b/examples/Tutorial_21_InsertHandleGroup/Tutorial_21_InsertHandleGroup.pde index ee27ec8..d6f726e 100644 --- a/examples/Tutorial_21_InsertHandleGroup/Tutorial_21_InsertHandleGroup.pde +++ b/examples/Tutorial_21_InsertHandleGroup/Tutorial_21_InsertHandleGroup.pde @@ -1,5 +1,3 @@ -import processing.xml.*; -import processing.opengl.*; import geomerative.*; RShape grp; @@ -10,7 +8,6 @@ boolean ignoringStyles = false; void setup(){ size(600, 600); smooth(); - g.smooth = true; // VERY IMPORTANT: Allways initialize the library before using it RG.init(this); diff --git a/examples/Tutorial_22_GetPointPaths/Tutorial_22_GetPointPaths.pde b/examples/Tutorial_22_GetPointPaths/Tutorial_22_GetPointPaths.pde index 8c24297..f1f95ea 100644 --- a/examples/Tutorial_22_GetPointPaths/Tutorial_22_GetPointPaths.pde +++ b/examples/Tutorial_22_GetPointPaths/Tutorial_22_GetPointPaths.pde @@ -1,4 +1,3 @@ -import processing.xml.*; import geomerative.*; RShape grp; diff --git a/examples/Tutorial_23_Contains/Tutorial_23_Contains.pde b/examples/Tutorial_23_Contains/Tutorial_23_Contains.pde index cc42562..9e98a1e 100644 --- a/examples/Tutorial_23_Contains/Tutorial_23_Contains.pde +++ b/examples/Tutorial_23_Contains/Tutorial_23_Contains.pde @@ -1,5 +1,3 @@ -import processing.xml.*; -import processing.opengl.*; import geomerative.*; RShape grp; @@ -9,7 +7,6 @@ boolean ignoringStyles = false; void setup(){ size(600, 600); smooth(); - g.smooth = true; // VERY IMPORTANT: Allways initialize the library before using it RG.init(this); diff --git a/examples/Tutorial_24_Intersection/Tutorial_24_Intersection.pde b/examples/Tutorial_24_Intersection/Tutorial_24_Intersection.pde index 8a26f86..2f89e9f 100644 --- a/examples/Tutorial_24_Intersection/Tutorial_24_Intersection.pde +++ b/examples/Tutorial_24_Intersection/Tutorial_24_Intersection.pde @@ -1,4 +1,3 @@ -import processing.xml.*; import processing.opengl.*; import geomerative.*; @@ -7,7 +6,6 @@ RShape shp; void setup(){ size(600, 600, OPENGL); smooth(); - g.smooth = true; // VERY IMPORTANT: Allways initialize the library before using it RG.init(this); diff --git a/examples/Tutorial_25_Closest/Tutorial_25_Closest.pde b/examples/Tutorial_25_Closest/Tutorial_25_Closest.pde index abe168b..51455c5 100644 --- a/examples/Tutorial_25_Closest/Tutorial_25_Closest.pde +++ b/examples/Tutorial_25_Closest/Tutorial_25_Closest.pde @@ -1,4 +1,3 @@ -import processing.xml.*; import processing.opengl.*; import geomerative.*; @@ -7,7 +6,6 @@ RShape shp; void setup(){ size(600, 600, OPENGL); smooth(); - g.smooth = true; // VERY IMPORTANT: Allways initialize the library before using it RG.init(this); diff --git a/examples/Tutorial_25_Closest_commands/Tutorial_25_Closest_commands.pde b/examples/Tutorial_25_Closest_commands/Tutorial_25_Closest_commands.pde index a75e592..34ba6c2 100644 --- a/examples/Tutorial_25_Closest_commands/Tutorial_25_Closest_commands.pde +++ b/examples/Tutorial_25_Closest_commands/Tutorial_25_Closest_commands.pde @@ -1,4 +1,3 @@ -import processing.xml.*; import processing.opengl.*; import geomerative.*; @@ -7,7 +6,6 @@ RCommand line1, line2; void setup(){ size(600, 600, OPENGL); smooth(); - g.smooth = true; // VERY IMPORTANT: Allways initialize the library before using it RG.init(this);