Skip to content

Commit

Permalink
update the examples
Browse files Browse the repository at this point in the history
  • Loading branch information
rikrd committed Dec 2, 2011
1 parent b7b2bc4 commit 321d31d
Show file tree
Hide file tree
Showing 20 changed files with 3 additions and 49 deletions.
@@ -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
Expand All @@ -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(){
Expand All @@ -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();
Expand Down
@@ -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;
Expand Down
@@ -1,5 +1,3 @@
import processing.xml.*;
import processing.opengl.*;
import geomerative.*;

RShape shp;
Expand Down
@@ -1,5 +1,3 @@
import processing.xml.*;
import processing.opengl.*;
import geomerative.*;

RShape shp;
Expand Down
@@ -1,5 +1,3 @@
import processing.xml.*;
import processing.opengl.*;
import geomerative.*;

RShape grp;
Expand Down
@@ -1,4 +1,3 @@
import processing.opengl.*;
import geomerative.*;

RCommand curva = new RCommand(0 , 0, -200, -200, 200, -200, 0, -100);
Expand All @@ -7,7 +6,6 @@ RCommand[] piezas = new RCommand[2];
void setup(){
size(600, 600);
smooth();
g.smooth = true;

RG.init(this);

Expand Down
@@ -1,4 +1,3 @@
import processing.opengl.*;
import geomerative.*;

RShape shp;
Expand All @@ -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);
Expand Down
@@ -1,5 +1,3 @@
import processing.xml.*;
import processing.opengl.*;
import geomerative.*;

RShape grp;
Expand All @@ -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);
Expand Down
@@ -1,5 +1,3 @@
import processing.xml.*;
import processing.opengl.*;
import geomerative.*;

RShape grp;
Expand Down
@@ -1,4 +1,3 @@
import processing.opengl.*;
import processing.pdf.*;
import geomerative.*;

Expand Down
@@ -1,5 +1,3 @@
import processing.xml.*;
import processing.opengl.*;
import geomerative.*;

RShape shp;
Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions examples/Tutorial_19_HelloAdapt/Tutorial_19_HelloAdapt.pde
@@ -1,5 +1,3 @@
import processing.xml.*;
import processing.opengl.*;
import geomerative.*;

RShape grp;
Expand Down
@@ -1,4 +1,3 @@
import processing.xml.*;
import geomerative.*;

RShape grp;
Expand Down
@@ -1,5 +1,3 @@
import processing.xml.*;
import processing.opengl.*;
import geomerative.*;

RShape shp;
Expand All @@ -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);
Expand Down
@@ -1,5 +1,3 @@
import processing.xml.*;
import processing.opengl.*;
import geomerative.*;

RShape grp;
Expand All @@ -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);
Expand Down
@@ -1,4 +1,3 @@
import processing.xml.*;
import geomerative.*;

RShape grp;
Expand Down
3 changes: 0 additions & 3 deletions examples/Tutorial_23_Contains/Tutorial_23_Contains.pde
@@ -1,5 +1,3 @@
import processing.xml.*;
import processing.opengl.*;
import geomerative.*;

RShape grp;
Expand All @@ -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);
Expand Down
@@ -1,4 +1,3 @@
import processing.xml.*;
import processing.opengl.*;
import geomerative.*;

Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions examples/Tutorial_25_Closest/Tutorial_25_Closest.pde
@@ -1,4 +1,3 @@
import processing.xml.*;
import processing.opengl.*;
import geomerative.*;

Expand All @@ -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);
Expand Down
@@ -1,4 +1,3 @@
import processing.xml.*;
import processing.opengl.*;
import geomerative.*;

Expand All @@ -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);
Expand Down

0 comments on commit 321d31d

Please sign in to comment.