de schets met dph = 2 en dpb = 2de schets met dph = 4 en dpb = 7

 

 

 

de schets met dph = 2 en dpb = 2

 de schets met dph = 2 en dpb = 2

 

 

dph = 6 en dpb =6

 de schets met dph = 6 en dpb = 6

 

 

header box hoek3d
 
animatie met boxen en 3d hoeken                                          terug naar de inleiding
 
de schets maakt gebruik van de superclass "Vormen" en de subclasses "Hoek3d_na4n", "Hoek3d_na2n", en "Box_nh"
 
Bekijk de heen en weer en op en neer bewegende boxen
 
Met de integers dbp en dph kan je de draaipunten van de boxen en 3d hoeken veranderen
 
 

Vormen [] vorm;  
void setup()  {    
 // fullScreen();  
  size(800,800);    
  float x = width/2;  
  float y = height/2;  
  float n   = height/20;  
  float a = sqrt(2*n*n);  
  int dpb = 7; 
  int dph = 4; 
  vorm = new Vormen[16];  
  vorm[0] = new Hoek3d_na4n(n, dph, x-5*n, y-5*n, -45,   
  color(#FF0000,100),color(#32FF0A,100),color(#57F539,50),color(#05FC06,50), color(#05FC06,50));    
    
  vorm[1] = new Hoek3d_na2n(n, dph, x-3*n, y-3*n, -45,   
  color(10,10,10,0),color(10,10,10,0),color(10,10,10,0),color(10,10,10,0), color(10,10,10,0));  
    
  vorm[2] = new Hoek3d_na4n(n, dph, x+5*n, y-5*n , 45,   
  color(#FF0000, 100),color(#32FF0A, 100),color(#57F539,50),color(#05FC06,50),color(#05FC06,50));  
    
  vorm[3] = new Hoek3d_na2n(n, dph, x+3*n, y-3*n , 45,   
  color(10,10,10,0),color(10,10,10,0),color(10,10,10,0),color(10,10,10,0),color(10,10,10,0));  
    
  vorm[4] = new Hoek3d_na4n(n, dph, x+5*n, y+5*n, 135,   
  color(#FF0000,100),color(#32FF0A, 100),color(#57F539,50),color(#05FC06,50),color(#05FC06,50));  
    
  vorm[5] = new Hoek3d_na2n(n, dph, x+3*n, y+3*n, 135,   
  color(10,10,10,0),color(10,10,10,0),color(10,10,10,0),color(10,10,10,0),color(10,10,10,0));  
      
  vorm[6] = new Hoek3d_na4n(n, dph, x-5*n, y+5*n, -135,   
  color(#FF0000,100),color(#32FF0A,100),color(#57F539,50),color(#05FC06, 50),color(#05FC06, 50));  
    
  vorm[7] = new Hoek3d_na2n(n, dph, x-3*n, y+3*n, -135,   
  color(10,10,10,0),color(10,10,10,0),color(10,10,10,0),color(10,10,10,0),color(10,10,10,0));  
    
  vorm[8] = new Box_nh(n*2, a, dpb, x-2*n, y-n, 45,  color(#3BF716,150), color(#228110,100), color(#64E34C,100));  
  vorm[9] = new Box_nh(n*2, a, dpb, x+2*n, y-n, -45, color(#3BF716,150), color(#228110,100), color(#64E34C,100));  
  vorm[10] = new Box_nh(n*2,a, dpb, x-2*n, y+n, 135, color(#3BF716,150), color(#228110,100), color(#64E34C,100));  
  vorm[11] = new Box_nh(n*2,a, dpb, x+2*n, y+n, -135,color(#3BF716,150), color(#228110,100), color(#64E34C,100));  
  vorm[12] = new Box_nh(n*2,a, dpb, x-n, y-2*n, -135,color(#3BF716,150), color(#228110,100), color(#64E34C,100));  
  vorm[13] = new Box_nh(n*2,a, dpb, x-n, y+2*n, -45, color(#3BF716,150), color(#228110,100), color(#64E34C,100));  
  vorm[14] = new Box_nh(n*2,a, dpb, x+n, y-2*n, 135, color(#3BF716,150), color(#228110,100), color(#64E34C,100));  
  vorm[15] = new Box_nh(n*2,a, dpb, x+n, y+2*n, 45,  color(#3BF716,150), color(#228110,100), color(#64E34C,100));  
}  
  
void draw()  {  
 background(#E6FBFF);  
   
  for (int i = 0; i < 16; i++)  
  {  
    vorm[i].display();  
  }  
     
  vorm[8].opEnNeer();     
  vorm[9].opEnNeer();  
  vorm[10].neerEnOp();  
  vorm[11].neerEnOp();  
  vorm[12].heenEnWeer();  
  vorm[13].heenEnWeer();  
  vorm[14].weerEnHeen();    
  vorm[15].weerEnHeen();  
}  
  
void keyPressed() {      
  if (key == 's') {     
    noLoop();   
  }      
  if (key == 'r') {        
    loop();   
  }   
}