Mrm2299

Babylon circle movement

Mar 21st, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1.  
  2. // Torus
  3. var torus = BABYLON.Mesh.CreateTorus("torus", 4, 2, 30, scene, false);
  4.  
  5. // Animations
  6. var alpha = 0;
  7. scene.registerBeforeRender(function () {
  8. torus.rotation.x += 0.001;
  9. torus.rotation.z += 0.02;
  10.  
  11. torus.position = new BABYLON.Vector3(Math.cos(alpha) * 30, 10, Math.sin(alpha) * 30);
  12. alpha += 0.001;
Advertisement
Add Comment
Please, Sign In to add comment