SHARE
TWEET

Untitled

a guest Nov 19th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function animate() {
  2.  
  3.     console.log("Run anim: "+runAnim);
  4.     if (!isPlay) return;
  5.  
  6.  
  7.       theta += 0.01;
  8.  
  9.  
  10.     requestAnimationFrame(animate);
  11.  
  12.     var t = clock.getElapsedTime();
  13.     var tmp = 8.0;
  14.     console.log("Time: "+t);
  15.     console.log("isPlay?: "+isPlay);
  16.    
  17.    
  18.     if (t>= tmp)
  19.     {
  20.         clock = new THREE.Clock;
  21.         isPlay = false;
  22.         if( Math.round(t)==8)
  23.         {
  24.             t=0;
  25.             isPlay = true;
  26.             console.log("Udany reset");
  27.         }
  28.     }
  29.     else
  30.     {
  31.    
  32.     /////ruszanie gora
  33.     cube_gora_1.position.y = (-0.5*t)+2;
  34.     cube_gora_1.position.x = (+0.5*t)-2;
  35.     cube_gora_1.position.z = (+0.5*t)-2;
  36.                              
  37.     cube_gora_2.position.y = (-0.5*t)+2;
  38.     cube_gora_2.position.z = (+0.5*t)-2;
  39.                                
  40.     cube_gora_3.position.y = (-0.5*t)+2;
  41.     cube_gora_3.position.x = (-0.5*t)+2;
  42.     cube_gora_3.position.z = (+0.5*t)-2;
  43.                                
  44.     cube_gora_4.position.x = (+0.5*t)-2;
  45.     cube_gora_4.position.y = (-0.5*t)+2;
  46.                                  
  47.     cube_gora_5.position.y = (-0.5*t)+2;
  48.                                  
  49.     cube_gora_6.position.x = (-0.5*t)+2;
  50.     cube_gora_6.position.y = (-0.5*t)+2;
  51.                                
  52.     cube_gora_7.position.y = (-0.5*t)+2;
  53.     cube_gora_7.position.x = (+0.5*t)-2;
  54.     cube_gora_7.position.z = (-0.5*t)+2;
  55.                                  
  56.     cube_gora_8.position.y = (-0.5*t)+2;
  57.     cube_gora_8.position.z = (-0.5*t)+2;
  58.                                
  59.     cube_gora_9.position.y = (-0.5*t)+2;
  60.     cube_gora_9.position.x = (-0.5*t)+2;
  61.     cube_gora_9.position.z = (-0.5*t)+2;
  62.    
  63.    
  64.     /////ruszanie srodek
  65.    
  66.     cube_srodek_1.position.x = (-0.5*t)+2;
  67.     cube_srodek_1.position.z = (-0.5*t)+2;
  68.                                  
  69.     cube_srodek_2.position.z = (-0.5*t)+2;
  70.                                    
  71.     cube_srodek_3.position.x = (+0.5*t)-2;
  72.     cube_srodek_3.position.z = (-0.5*t)+2;
  73.                                    
  74.     cube_srodek_4.position.x = (-0.5*t)+2;
  75.     //cube_srodek_5.position.y (+0.5*t);
  76.     cube_srodek_6.position.x = (+0.5*t)-2;
  77.                                    
  78.     cube_srodek_7.position.x = (-0.5*t)+2;
  79.     cube_srodek_7.position.z = (+0.5*t)-2;
  80.                                    
  81.     cube_srodek_8.position.z = (+0.5*t)-2;
  82.                                    
  83.     cube_srodek_9.position.x = (+0.5*t)-2;
  84.     cube_srodek_9.position.z = (+0.5*t)-2;
  85.    
  86.    
  87.    
  88.    
  89.    
  90.     /////ruszanie dol
  91.     cube_dol_1.position.y = (+0.5*t)-2;
  92.     cube_dol_1.position.x = (+0.5*t)-2;
  93.     cube_dol_1.position.z = (-0.5*t)+2;
  94.                                
  95.     cube_dol_2.position.y = (+0.5*t)-2;
  96.     cube_dol_2.position.z = (+0.5*t)-2;
  97.                                
  98.     cube_dol_3.position.y = (+0.5*t)-2;
  99.     cube_dol_3.position.x = (-0.5*t)+2;
  100.     cube_dol_3.position.z = (+0.5*t)-2;
  101.                                
  102.     cube_dol_4.position.x = (+0.5*t)-2;
  103.     cube_dol_4.position.y = (+0.5*t)-2;
  104.                                
  105.     cube_dol_5.position.y = (+0.5*t)-2;
  106.                                
  107.     cube_dol_6.position.x = (-0.5*t)+2;
  108.     cube_dol_6.position.y = (+0.5*t)-2;
  109.                                
  110.     cube_dol_7.position.y = (+0.5*t)-2;
  111.     cube_dol_7.position.x = (+0.5*t)-2;
  112.     cube_dol_7.position.z = (+0.5*t)-2;
  113.                                  
  114.     cube_dol_8.position.y = (+0.5*t)-2;
  115.     cube_dol_8.position.z = (-0.5*t)+2;
  116.                                
  117.     cube_dol_9.position.y = (+0.5*t)-2;
  118.     cube_dol_9.position.x = (-0.5*t)+2;
  119.     cube_dol_9.position.z = (-0.5*t)+2;
  120.    
  121.     t = 0;
  122.    
  123. }
  124. renderer.render(scene, camera);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top