Animatie met "Z", "F" , "Drieh_nh en "Paral_na                 terug naar de inleiding 

 bekijk de animatie      de schets maakt gebruik van, objecten van, de classes "Z", "F" , "Drieh_nh" , "Paral_na" en de superclass "Vormen"

 

Vormen[] vorm = new Vormen[13]; 
void setup() {  
  fullScreen();  
 // size(960, 560);  
  float x = width/2;  
  float y = height/2;  
  float n = height/12;  
  vorm[0] = new Z       (n,0,      6, x-5.5*n, y,    0, color(200,255,0, 100));    
  vorm[1] = new Drieh_nh(3*n, 2*n, 1, x-5.5*n, y,    0, color(0,  255,0, 100));    
  vorm[2] = new F       (n,1,      6, x-1.5*n, y+n,180, color(200,100,  0, 100));     
  vorm[3] = new Drieh_nh(3*n, 2*n, 3, x,       y-3*n,0, color(0,255,  0, 100));    
  vorm[4] = new F       (n,0,      5, x+1.5*n, y+n,180, color(200,100,  0, 100));      
  vorm[5] = new Drieh_nh(3*n, 2*n, 5, x+5.5*n, y,    0, color(0,255,  0, 100));      
  vorm[6] = new Z       (n,1,      3, x+5.5*n, y,    0, color(200,255,0, 100));    
  vorm[7] = new Paral_na(n,1,      1, x-1.5*n, y+n,  0, color(0,0,  200, 100));   
  vorm[8] = new Paral_na(n,0,      7, x+1.5*n, y+n,  0, color(0,0,  200, 100));     
  vorm[9] = new Paral_na(n,0,      3, x-1.5*n, y+2*n,0, color(0,0,  200, 100));   
  vorm[10] = new Paral_na(n,1,     5, x+1.5*n, y+2*n,0, color(0,0,  200, 100)); 
  vorm[11] = new Drieh_nh(4*n,2*n, 4, x-1.5*n, y+2*n,0, color(0,200,200, 100));    
  vorm[12] = new Drieh_nh(4*n,2*n, 2, x+1.5*n, y+2*n,0, color(0,200,200, 100));    
   
}  
  
void draw() {  
  background(#E6FBFF);  
  for (int i =0; i < 13; i++)  
  {  
    vorm[i].display();  
  }     
    vorm[0].dpRotRe(vorm[0]);  
    vorm[1].dpRotLi(vorm[1]);  
    vorm[2].dpRotRe(vorm[2]);  
    vorm[4].dpRotLi(vorm[4]);    
    vorm[5].dpRotRe(vorm[5]);  
    vorm[6].dpRotLi(vorm[6]);  
    vorm[7].dpRotLi(vorm[7]);  
    vorm[8].dpRotRe(vorm[8]);    
    vorm[9].dpRotRe(vorm[9]);  
    vorm[10].dpRotLi(vorm[10]);  
    vorm[11].dpRotLi(vorm[11]);  
    vorm[12].dpRotRe(vorm[12]);  
}  
  
void keyPressed() {       
  if (key == 's') {      
    noLoop();  
  }         
  if (key == 'r') {         
    loop();  
  }  
}