Gyroscope.html 889 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <script src="../../../list.js"></script>
  6. <script src="../../../page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="../../../page.css" />
  8. </head>
  9. <body>
  10. [page:Object3D] &rarr;
  11. <h1>[name]</h1>
  12. <div class="desc">An Object3d that rotates independently of its parent objects, but keeps the position and scale.</div>
  13. <code>
  14. var root = new THREE.Group();
  15. var gyro = new THREE.Gyroscope();
  16. var cube = new THREE.Mesh( geometry, material );
  17. root.add( gyro )
  18. gyro.add( cube )
  19. cube.position.x = 10;
  20. root.rotation.y = Math.PI;
  21. // The cube will have changed its position but maintained its orientation
  22. </code>
  23. <h2>Constructor</h2>
  24. <h3>[name]()</h3>
  25. <h2>Source</h2>
  26. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  27. </body>
  28. </html>