Cette page appartient aux archives web de l'EPFL et n'est plus tenue à jour.
This page belongs to EPFL's web archive and is no longer updated.

Raphaël Berclaz

HexagonalTower's Code

 

import superCAD.*;
import oog.*;
import processing.opengl.*;
import processing.dxf.*;
boolean record = false;

Oog goo;

Oog myScene;
Obj myObj = new Obj();
Obj seulementLesSubFaces = new Obj();
Obj splitTower = new Obj();
Sliders mySliders;

public void setup(){
  size(1200,800,OPENGL);
  frameRate(200);

  myScene = new Oog(this);
  Scene.drawAxis = true;
  Pts.globalRender = new RenderPtsAll();
  initForm();
}

//////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////// 

void initForm() {

  int nbEtages = 30; 
  int nbPts = 50;            ////////////// numbers of points on each circle /////////////
  int h = 25; 
  int echelle = 20;
  float alfa = 2*PI/nbPts;   

  ////////////// a set of transformations /////////////////////
 
  RotateZ cercle = new RotateZ(alfa);
  Scale s = new Scale(1,1,1);
 
  ///////////// differents parameters ////////////////////
 
  Param hh = new Param(h);
  myScene.slidersAdd(hh);
 
  Param ee = new Param(echelle);
  myScene.slidersAdd(ee);

  myScene.slidersAdd(s);
 
  //First construction: a basic line
  Pts construction = new Pts();

  construction.add(5*echelle,0*echelle);
  construction.add(6*echelle,3*echelle);
  construction.add(4*echelle,5*echelle);
  construction.add(0*echelle,4*echelle);
  construction.add(-4*echelle,5*echelle);
  construction.add(-6*echelle,3*echelle);
  construction.add(-5*echelle,0*echelle);
  construction.add(-6*echelle,-3*echelle);
  construction.add(-4*echelle,-5*echelle);
  construction.add(0*echelle,-4*echelle);
  construction.add(4*echelle,-5*echelle);
  construction.add(6*echelle,-3*echelle);
  construction.add(5*echelle,0*echelle); 
  construction.stroke(155,0,0);

  ////////////////// Creation of the curve //////////////////////

  //From this first set of points, create a curve of degree 4
  CSpline curve = new CSpline(construction,4);
  curve.stroke(255,155,155);

  Pts curveWithUniformPts = curve.getPts(nbPts);

  Pts[] myLines = new Pts[nbEtages]; 
  Face[] myFloors = new Face[nbEtages];
 
  Pt a = new PtCurve(curve,(0));

  for (int i=0 ; i<nbEtages ; i++)
  { 
    myLines[i] = new Pts();   
    myFloors[i] = new Face();
   
    for (int j=0 ; j<nbPts ; j++) {
      Pt aCopy = Pt.create(curveWithUniformPts.pt(j));
      myLines[i].add(aCopy);
      a = aCopy;
     
      if (i%2==1)
      {       
        myFloors[i].add(aCopy);
      } 
    }
   
    myLines[i].apply(new TranslateZ(new ParamMul(hh,i)));
    myFloors[i].apply(new TranslateZ(new ParamMul(hh,i)));
    myLines[i].apply(s);
    myFloors[i].apply(s);
    myObj.add(myFloors[i]);
    myFloors[i].fill(153,153,153);
    //myLines[i].apply(cercle);
    //myObj.add(myLines[i]);
    //myObj.add(curve);
    //myObj.add(construction);
    //myObj.add(curveWithUniformPts);
  }


  for (int i=0 ; i<myLines.length-2 ; i+=2) {              ///////// boucle pour chaque cercle /////////////////////////////
    for (int j=0 ; j<myLines[i].numOfPts()-1 ; j+=2){      ///////// boucle pour chaque points "j" du cercle[i] ////////////

      int decal = (i/2)%2+j;
      int n = myLines[i].numOfPts();     
      //int mid = (int)random(1,5);
      int mid = 15;
     
      Param mm = new Param(mid);
      //myScene.slidersAdd(mm);
  
      ///////////////////////////////////////////////////////////////////////////////////
      /////////////// Définition des 6 sommets de l'hexagone d'orignine /////////////////
      ///////////////////////////////////////////////////////////////////////////////////
     
      Pt p0  = myLines[i].pt((1+decal)%n);
      Pt pa1 = myLines[i+1].pt((0+decal)%n);
      Pt pb1 = myLines[i+1].pt((2+decal)%n);
      Pt pa2 = myLines[i+2].pt((0+decal)%n);
      Pt pb2 = myLines[i+2].pt((2+decal)%n);
      Pt p3  = myLines[i+3].pt((1+decal)%n);    
     
      //////////////// Création de subdivisions pour chaque diagonales de l'hexagone //////////////  

      PtsMid vertical = new PtsMid(p0,p3,mid);     
      PtsMid diagonale = new PtsMid(pa1,pb2,mid);
      PtsMid diagonale2 = new PtsMid(pa2,pb1,mid);     
      //myObj.add(vertical);
      //myObj.add(diagonale);
      //myObj.add(diagonale2);
        
      Pt pc0 = vertical.pt(1);
      Pt pc1 = diagonale.pt(1);
      Pt pc2 = diagonale2.pt(1);
      Pt pc3 = vertical.pt(mid-1);
      Pt pc4 = diagonale.pt(mid-1);   
      Pt pc5 = diagonale2.pt(mid-1);
     
      seulementLesSubFaces.add(createSubFace(p0, pa1, pb1, pa2, pb2, p3, pc0, pc1, pc2, pc3, pc4, pc5));
      }
    } 
   
  myScene.sliders.add(s);
  myScene.slidersAdd(cercle); 
  myScene.slidersAdd(ee);
 
  }
 
 ///////////////////////////// Création des faces /////////////////////////////////////////
 
  Obj createSubFace(Pt p0, Pt pa1, Pt pa2, Pt p3, Pt pb2, Pt pb1, Pt pc0,Pt pc1, Pt pc2, Pt pc3, Pt pc4, Pt pc5) {
 
  Obj module = new Obj();

    Face f1 = new Face();
    f1.add(p0);
    f1.add(pa1);
    f1.add(pc1);
    f1.add(pc0);
    //module.add(f1);

    Face f2 = new Face();
    f2.add(pa1);
    f2.add(p3);
    f2.add(pc2); 
    f2.add(pc1);
    //module.add(f2);

    Face f3 = new Face();
    f3.add(p3);
    f3.add(pb1);
    f3.add(pc3);
    f3.add(pc2);   
    //module.add(f3);

    Face f4 = new Face();
    f4.add(pb1);
    f4.add(pb2);
    f4.add(pc4);
    f4.add(pc3);   
    //module.add(f4);

    Face f5 = new Face();   
    f5.add(pb2);
    f5.add(pa2);
    f5.add(pc5); 
    f5.add(pc4);
    //module.add(f5);

    Face f6 = new Face();    
    f6.add(pa2);
    f6.add(p0);
    f6.add(pc0);
    f6.add(pc5); 
    //module.add(f6);

 ////////////////// articulation en 3Dimension /////////////////////
 ////////////////// création de points normaux aux six faces précédemment créées ////////////////
 
    //int lengtNormal = (int)random(0,8); 
    int lengtNormal = 5;
   
    Pt ptnorm1 = new PtNormal(f1,-lengtNormal);
    Pt ptnorm1b = new PtNormal(f1,0);      
    Pt ptnorm2 = new PtNormal(f2,-lengtNormal);
    Pt ptnorm2b = new PtNormal(f2,0);       
    Pt ptnorm3 = new PtNormal(f3,-lengtNormal);
    Pt ptnorm3b = new PtNormal(f3,0);       
    Pt ptnorm4 = new PtNormal(f4,-lengtNormal);
    Pt ptnorm4b = new PtNormal(f4,0);       
    Pt ptnorm5 = new PtNormal(f5,-lengtNormal);
    Pt ptnorm5b = new PtNormal(f5,0);        
    Pt ptnorm6 = new PtNormal(f6,-lengtNormal);
    Pt ptnorm6b = new PtNormal(f6,0);
   
    /*   
    Pts construction2 = new Pts();
     
    construction2.add(ptnorm1);   
    construction2.add(ptnorm2);
    construction2.add(ptnorm3);
    construction2.add(ptnorm4);
    construction2.add(ptnorm5);
    construction2.add(ptnorm6);
     
    CSpline curve2 = new CSpline(construction2,4);
    myObj.add(curve2);
    */
   
 //////////// Création des faces liant le pourtour de l'hexagone aux points normaux //////////////   
   
    Face face1 = new Face();   
    face1.add(p0);
    face1.add(pa1);
    face1.add(ptnorm1);
    module.add(face1);
 
    Face face2 = new Face();   
    face2.add(ptnorm1);
    face2.add(ptnorm2);
    face2.add(pa1);
    module.add(face2);

    Face face3 = new Face();   
    face3.add(p3);
    face3.add(pa1);
    face3.add(ptnorm2);
    module.add(face3);

    Face face4 = new Face();   
    face4.add(ptnorm2);
    face4.add(ptnorm3);
    face4.add(p3);
    module.add(face4);

    Face face5 = new Face();   
    face5.add(pb1);
    face5.add(p3);
    face5.add(ptnorm3);
    module.add(face5);

    Face face6 = new Face();   
    face6.add(pb1);
    face6.add(ptnorm3);
    face6.add(ptnorm4);
    module.add(face6);

    Face face7 = new Face();   
    face7.add(pb2);
    face7.add(pb1);
    face7.add(ptnorm4);
    module.add(face7);

    Face face8 = new Face();   
    face8.add(pb2);
    face8.add(ptnorm4);
    face8.add(ptnorm5);
    module.add(face8);

    Face face9 = new Face();   
    face9.add(pa2);
    face9.add(pb2);
    face9.add(ptnorm5);
    module.add(face9);

    Face face10 = new Face();   
    face10.add(pa2);
    face10.add(ptnorm5);
    face10.add(ptnorm6);
    module.add(face10);

    Face face11 = new Face();   
    face11.add(p0);
    face11.add(pa2);
    face11.add(ptnorm6);
    module.add(face11);

    Face face12 = new Face();   
    face12.add(p0);
    face12.add(ptnorm6);
    face12.add(ptnorm1);
    module.add(face12);

///////////////////////// Faces intérieures //////////////////////////
   
    Face face13 = new Face();   
    face13.add(ptnorm3);
    face13.add(ptnorm4);
    face13.add(ptnorm4b);
    face13.add(ptnorm3b);
    module.add(face13);
   
    Face face14 = new Face();   
    face14.add(ptnorm4);
    face14.add(ptnorm5);
    face14.add(ptnorm5b);
    face14.add(ptnorm4b);
    module.add(face14);
   
    Face face15 = new Face();   
    face15.add(ptnorm5);
    face15.add(ptnorm6);
    face15.add(ptnorm6b);
    face15.add(ptnorm5b);
    module.add(face15);   
   
    Face face16 = new Face();   
    face16.add(ptnorm6);
    face16.add(ptnorm1);
    face16.add(ptnorm1b);
    face16.add(ptnorm6b);
    module.add(face16);
   
    Face face17 = new Face();   
    face17.add(ptnorm1);
    face17.add(ptnorm2);
    face17.add(ptnorm2b);
    face17.add(ptnorm1b);
    module.add(face17);
   
    Face face18 = new Face();   
    face18.add(ptnorm2);
    face18.add(ptnorm3);
    face18.add(ptnorm3b);
    face18.add(ptnorm2b);
    module.add(face18);

    face1.fill(183,183,183);
    face2.fill(183,183,183);
    face3.fill(183,183,183);
    face4.fill(183,183,183);
    face5.fill(183,183,183);
    face6.fill(183,183,183);
    face7.fill(183,183,183);
    face8.fill(183,183,183);
    face9.fill(183,183,183);
    face10.fill(183,183,183);
    face11.fill(183,183,183);
    face12.fill(183,183,183);  
    face13.fill(183,183,183);
    face14.fill(183,183,183);
    face15.fill(183,183,183);
    face16.fill(183,183,183);
    face17.fill(183,183,183);
    face18.fill(183,183,183);
   
    //Param ln = new Param(lengtNormal);
    //myScene.slidersAdd(ln); 
   
    return module;
   
}

 

void draw() {
  if (record == true) {
    beginRaw(DXF, "output.dxf"); // Start recording to the file
  }
  background(255);
  myObj.draw(); 
  seulementLesSubFaces.draw();
  //grid.draw();
  if (record == true) {
    endRaw();
    record = false; // Stop recording to the file
  }
}

void keyPressed() {
  if (key == 'R' || key == 'r') { // Press R to save the file
    record = true;
  }
}
 

Posted by Raphaël Berclaz at 9:12
The HexagonalTower in Manhattan

.

Posted by Raphaël Berclaz at 9:10
module in 3Dimension

Here I developp the module in 3Dimension using normal points.

Posted by Raphaël Berclaz at 10:11
The watercube in construction

We can see that there is a superposition of two grid which are based on the weaired phelan solution.

Posted by Raphaël Berclaz at 10:16
The construction of the house of bubbles

The fassades have a rondomness apparence, but there is a logical way to construct those.

Posted by Raphaël Berclaz at 10:12
Hexagonal Tower, the return

import superCAD.*;

import oog.*;

import processing.opengl.*;

import processing.dxf.*;

boolean record = false;

Oog goo;

Oog myScene;

Obj myObj = new Obj();

Obj seulementLesSubFaces = new Obj();

Sliders mySliders;

public void setup(){

size(1200,800,OPENGL);

frameRate(200);

myScene = new Oog(this);

Scene.drawAxis = true;

//Pts.globalRender = new RenderPtsAll();

initForm();

}

//////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////

void initForm() {

int nbEtages = 40;

int nbPts = 40; //////////////numbers of points on the circle/////////////

int h = 10;

int rayon = 50;

float alfa = 2*PI/nbPts;

RotateZ cercle = new RotateZ(alfa);

 

Scale s = new Scale(1.05,1,.9);

myScene.slidersAdd(s);

//RotateZ cercle2 = new RotateZ(beta);

 

Param hh = new Param(h);

myScene.slidersAdd(hh);

 

Param rr = new Param(rayon);

myScene.slidersAdd(rr);

//Create four first points with absolute coordinates

Pt a = new PtABS();

a.x(rr);

///////////Create circles using array////////////////////////

Pts[] myLines = new Pts[40];

for (int i=0 ; i<nbEtages ; i++)

{

myLines[i] = new Pts();

for (int j=0 ; j<nbPts ; j++) {

Pt aCopy = Pt.create(a,cercle);

myLines[i].add(aCopy);

a = aCopy;

}

//myLines[i].translate(0,0,i*h);

myLines[i].apply(new TranslateZ(new ParamMul(hh,i)));

myLines[i].apply(s);

//myObj.add(myLines[i]);

}

///////////Create lines between circles////////////////////////

for (int i=0 ; i<20-2 ; i++){ /////////boucle pour chaque cercle

for (int j=0 ; j<nbPts ; j+=1) /////////boucle pour chaque points du cercle

{

int iplus = 0;

if ((i/2)%2==1){

iplus = 1;

}

if(i%2==1) {

if (j%2==0) {

Pts maVerticale = new Pts();

maVerticale.add( myLines[i].pt((j+iplus)%nbPts) );

maVerticale.add( myLines[i+1].pt((j+iplus)%nbPts) );

//myObj.add(maVerticale);

Pts maDiagonale = new Pts();

maDiagonale.add( myLines[i].pt((j+iplus)%nbPts) );

maDiagonale.add( myLines[i+1].pt((j+2+iplus)%nbPts) );

maDiagonale.stroke(155,0,0);

//myObj.add(maDiagonale);

Pts maDiagonale2 = new Pts();

maDiagonale2.add( myLines[i+1].pt((j+iplus)%nbPts) );

maDiagonale2.add( myLines[i].pt((j+2+iplus)%nbPts) );

maDiagonale2.stroke(155,0,0);

//myObj.add(maDiagonale2);

}

}

else {

if (j%2==1) {

Pts maNouvelleLigne = new Pts();

maNouvelleLigne.add( myLines[i].pt((j+iplus)%nbPts) );

maNouvelleLigne.add( myLines[i+1].pt((j+1+iplus)%nbPts) );

maNouvelleLigne.add( myLines[i].pt((j+2+iplus)%nbPts) );

//myObj.add(maNouvelleLigne);

Pts maVerticale2 = new Pts();

maVerticale2.add( myLines[i].pt((j+iplus)%nbPts));

maVerticale2.add( myLines[i+3].pt((j+iplus)%nbPts));

maVerticale2.stroke(155,0,0);

//myObj.add(maVerticale2);

}

}

}

}

for (int i=0 ; i<myLines.length-4 ; i+=2) { /////////boucle pour chaque cercle

for (int j=0 ; j<myLines[i].numOfPts()-1 ; j+=2){

int decal = (i/2)%2+j;

int n = myLines[i].numOfPts();

int mid = (int)random(2,10);

 

Pt p0 = myLines[i].pt((1+decal)%n);

Pt pa1 = myLines[i+1].pt((0+decal)%n);

Pt pb1 = myLines[i+1].pt((2+decal)%n);

Pt pa2 = myLines[i+2].pt((0+decal)%n);

Pt pb2 = myLines[i+2].pt((2+decal)%n);

Pt p3 = myLines[i+3].pt((1+decal)%n);

PtsMid vertical = new PtsMid(p0,p3,mid);

//myObj.add(vertical);

PtsMid diagonale = new PtsMid(pa1,pb2,mid);

//myObj.add(diagonale);

PtsMid diagonale2 = new PtsMid(pa2,pb1,mid);

//myObj.add(diagonale2);

 

Pt pc0 = vertical.pt(1);

Pt pc1 = diagonale.pt(1);

Pt pc2 = diagonale2.pt(1);

Pt pc3 = vertical.pt(mid-1);

Pt pc4 = diagonale.pt(mid-1);

Pt pc5 = diagonale2.pt(mid-1);

 

seulementLesSubFaces.add(createSubFace(p0, pa1, pb1, pa2, pb2, p3, pc0, pc1, pc2, pc3, pc4, pc5));

}

}

}

 

///////////////////////////// Création des faces /////////////////////////////////////////77

 

Obj createSubFace(Pt p0, Pt pa1, Pt pa2, Pt p3, Pt pb2, Pt pb1, Pt pc0,Pt pc1, Pt pc2, Pt pc3, Pt pc4, Pt pc5) {

 

Obj module = new Obj();

Face f1 = new Face();

f1.add(p0);

f1.add(pa1);

f1.add(pc1);

module.add(f1);

Face f2 = new Face();

f2.add(p0);

f2.add(pc1);

f2.add(pc0);

module.add(f2);

Face f3 = new Face();

f3.add(pa1);

f3.add(p3);

f3.add(pc2);

module.add(f3);

Face f4 = new Face();

f4.add(pa1);

f4.add(pc2);

f4.add(pc1);

module.add(f4);

Face f5 = new Face(); ////// en haut à droite

f5.add(pb1);

f5.add(pc2);

f5.add(pc3);

module.add(f5);

Face f6 = new Face(); ////// en haut à droite

f6.add(pb1);

f6.add(p3);

f6.add(pc2);

module.add(f6);

Face f7 = new Face(); ////// en haut à gauche

f7.add(pb1);

f7.add(pb2);

f7.add(pc3);

module.add(f7);

 

Face f8 = new Face(); ////// en haut à gauche

f8.add(pc3);

f8.add(pc4);

f8.add(pb2);

module.add(f8);

Face f9 = new Face(); ////// à gauche

f9.add(pc4);

f9.add(pb2);

f9.add(pa2);

module.add(f9);

Face f10 = new Face(); ////// à gauche

f10.add(pa2);

f10.add(pc4);

f10.add(pc5);

module.add(f10);

Face f11 = new Face(); ////// en bas à gauche

f11.add(p0);

f11.add(pa2);

f11.add(pc0);

module.add(f11);

 

Face f12 = new Face(); ////// en bas à gauche

f12.add(pa2);

f12.add(pc5);

f12.add(pc0);

module.add(f12);

 

return module;

}

//Create Sliders based on an object

//myScene.sliders(myObj);

//goo.sliders(myObj2);

//myScene.slidersAdd(cercle);

void draw() {

if (record == true) {

beginRaw(DXF, "output.dxf"); // Start recording to the file

}

background(255);

myObj.draw();

seulementLesSubFaces.draw();

if (record == true) {

endRaw();

record = false; // Stop recording to the file

}

}

void keyPressed() {

if (key == 'R' || key == 'r') { // Press R to save the file

record = true;

}

}

Posted by Raphaël Berclaz at 16:37
Hexagonal tower

 

import oog.*;

import processing.opengl.*;

 

Oog goo;

Oog myScene;

Obj myObj = new Obj();

Sliders mySliders;

public void setup(){

size(800,400,OPENGL);

frameRate(200);

myScene = new Oog(this);

Scene.drawAxis = true;

initForm();

}

 

void initForm() {

//////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////

 

int nbPts = 16;

int h = 10;

int rayon = 40;

float alfa = 2*PI/nbPts;

 

RotateZ cercle = new RotateZ(alfa);

Translate t1 = new Translate(0,0,h);

 

//Create four first points with absolute coordinates

Pt a = Pt.create(rayon,0);

 

///////////Create circles using array////////////////////////

 

Pts[] myLines = new Pts[20];

 

for (int i=0 ; i<20 ; i++)

{

myLines[i] = new Pts();

 

for (int j=0 ; j<nbPts ; j++) {

Pt aCopy = Pt.create(a);

aCopy.apply(cercle);

myLines[i].add(aCopy);

a = aCopy;

}

 

myLines[i].translate(0,0,i*10);

 

//myObj.add(myLines[i]);

}

 

///////////Create lines between circles////////////////////////

for (int i=0 ; i<20-1 ; i++){

for (int j=0 ; j<nbPts ; j+=2)

{

 

int iplus = 0;

 

if ((i/2)%2==1){

iplus = 1;

}

 

if(i%2==0) {

 

Pts maNouvelleLigne = new Pts();

maNouvelleLigne.add( myLines[i].pt((j+iplus)%nbPts) );

maNouvelleLigne.add( myLines[i+1].pt((j+iplus)%nbPts) );

myObj.add(maNouvelleLigne);

}

else {

 

Pts maNouvelleLigne = new Pts();

maNouvelleLigne.add( myLines[i].pt((j+iplus)%nbPts) );

maNouvelleLigne.add( myLines[i+1].pt((j+1+iplus)%nbPts) );

maNouvelleLigne.add( myLines[i].pt((j+2+iplus)%nbPts) );

myObj.add(maNouvelleLigne);

}

}

}

//Create Sliders based on an object

myScene.sliders(myObj);

//goo.sliders(myObj2);

 

}

void draw() {

background(255);

myObj.draw();

 

}

Posted by Raphaël Berclaz at 17:53
The Splittower

import oog.*;

import processing.opengl.*;

Oog myScene;

Obj myObj = new Obj();

Obj splitTower = new Obj();

Sliders mySliders;

public void setup(){

size(1200,800,OPENGL);

frameRate(200);

myScene = new Oog(this);

Scene.drawAxis = true;

 

mySliders = new Sliders();

initForm();

}

void initForm(){

//Definition of shape parameters

int numOfSides = 8;

float theta = 2*PI/numOfSides;

//Create a first point with absolute coordinates

Pt a = Pt.create(20,20);

// rotation

RotateZ r = new RotateZ(theta);

//Create a new Face

Face mySquare = new Face();

for (int i=0; i<numOfSides; i++) {

//Create a point from a previous

Pt newPt = Pt.create(a,r);

mySquare.add(newPt);

a = newPt;

}

Obj oriSquare = new Extrude(mySquare,Pt.create(0,0,-4));

//Create a new set of Transformations

Transform myTransform = new Transform();

myTransform.translate(0,0,3);

Transform myTransform2 = new Transform();

myTransform2.apply(myTransform);

myTransform2.scale(.97,.97,1);

//myTransform2.rotateZ(2*PI/72);

Obj mySquare2 = new Obj(oriSquare);

for(int i=0; i<80; i++)

{

Obj tmp = new Obj(mySquare2);

if(i<50)

tmp.apply(myTransform);

else

{

Origine fromHere = new Origine(mySquare2.face(0).pt(0),myTransform2);

tmp.apply(fromHere);

}

myObj.add(tmp);

mySquare2 = tmp;

}

myObj.translate(20,20,0);

 

RotateZ rotZ = new RotateZ(PI/4);

 

Obj oriObj = myObj;

for(int i=0; i<8; i++)

{

Obj rotatedPart = new Obj(oriObj);

rotatedPart.apply(myTransform);

rotatedPart.apply(rotZ);

splitTower.add(rotatedPart);

oriObj = rotatedPart;

}

 

myScene.sliders(splitTower);

mySliders.add(rotZ);

mySliders.add(myTransform);

mySliders.add(a);

mySliders.add(myTransform2);

}

 

void draw(){

background(255);

splitTower.draw();

mySliders.draw();

}

Posted by Raphaël Berclaz at 9:24
Exercice2

The Spiral Tower

Codes pour 4 spirales tournant dans le même sens:

 

for(float i=1; i<=10; i=i+0.05) {

 

myList.add(Pt.create(i*20*cos(i),i*20*sin(i),i*200));

}

form.add(myList);

 

for(float i=1; i<=10; i=i+0.05) {

 

myList2.add(Pt.create(-(i*20)*cos(i),-(i*20)*sin(i),i*200));

}

form.add(myList2);

 

for(float i=1; i<=10; i=i+0.05) {

 

myList3.add(Pt.create((i*20)*sin(i),-(i*20)*cos(i),i*200));

}

 

form.add(myList3);

 

for(float i=1; i<=10; i=i+0.05) {

 

myList4.add(Pt.create(-(i*20)*sin(i),(i*20)*cos(i),i*200));

}

form.add(myList4);

Posted by Raphaël Berclaz at 12:35
Exercice1

The tower of Herzog and The Meuron

Posted by Raphaël Berclaz at 9:42