LOD.html 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. [page:Object3D] &rarr;
  12. <h1>[name]</h1>
  13. <div class="desc">Level of Detail - Show meshes with more or less geometry based on distance.</div>
  14. <h2>Example</h2>
  15. <div>
  16. [example:webgl_lod LOD]
  17. </div>
  18. <code>
  19. var lod = new THREE.LOD();
  20. //Create 5 levels of spheres
  21. for( var i = 0; i < 5; i++ ) {
  22. var geometry = new THREE.IcosahedronGeometry( 10, 5 - i )
  23. new THREE.Mesh( geometry, material );
  24. lod.addLevel( mesh, i * 50 );
  25. }
  26. </code>
  27. <h2>Constructor</h2>
  28. <h3>[name]()</h3>
  29. <h2>Properties</h2>
  30. <h3>[property:array objects]</h3>
  31. <div>
  32. An array of [page:Object3D Object3Ds]
  33. </div>
  34. <h2>Methods</h2>
  35. <h3>[method:null addLevel]([page:Object3D mesh], [page:Float distance])</h3>
  36. <div>
  37. mesh -- The Object3D to display <br />
  38. distance -- The distance at which to display this level of detail
  39. </div>
  40. <div>
  41. Adds a mesh that will display at a certain distance and greater. Typically the further away the distance,
  42. the lower the detail on the mesh.
  43. </div>
  44. <h3>[method:Object3D getObjectForDistance]([page:Float distance])</h3>
  45. <div>
  46. Get a reference to the first [page:Object3D] (mesh) that is greater than supplied distance.
  47. </div>
  48. <h3>[method:null update]([page:Camera camera])</h3>
  49. <div>
  50. camera -- The current camera
  51. </div>
  52. <div>
  53. Update the visiblility of the level of detail based on the distance from the camera.
  54. </div>
  55. <h3>[method:Object3D clone]([page:Object3D object])</h3>
  56. <div>
  57. object -- (optional) Object3D which needs to be cloned. If undefined, clone method will create a new cloned LOD Object.
  58. </div>
  59. <div>
  60. Clone a LOD Object.
  61. </div>
  62. <h2>Source</h2>
  63. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  64. </body>
  65. </html>