LOD.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. <div>See the base [page:Object3D] class for common properties.</div>
  31. <h3>[property:array levels]</h3>
  32. <div>
  33. An array of [page:object level] objects
  34. </div>
  35. <div>
  36. level is an object with two properties.
  37. </div>
  38. <div>
  39. distance -- The distance at which to display this level of detail<br />
  40. object -- The Object3D which will be displayed
  41. </div>
  42. <h2>Methods</h2>
  43. <div>See the base [page:Object3D] class for common methods.</div>
  44. <h3>[method:null addLevel]( [page:Object3D mesh], [page:Float distance] )</h3>
  45. <div>
  46. mesh -- The Object3D to display <br />
  47. distance -- The distance at which to display this level of detail
  48. </div>
  49. <div>
  50. Adds a mesh that will display at a certain distance and greater. Typically the further away the distance,
  51. the lower the detail on the mesh.
  52. </div>
  53. <h3>[method:Object3D getObjectForDistance]( [page:Float distance] )</h3>
  54. <div>
  55. Get a reference to the first [page:Object3D] (mesh) that is greater than supplied distance.
  56. </div>
  57. <h3>[method:null update]( [page:Camera camera] )</h3>
  58. <div>
  59. camera -- The current camera
  60. </div>
  61. <div>
  62. Update the visiblility of the level of detail based on the distance from the camera.
  63. </div>
  64. <h3>[method:LOD clone]()</h3>
  65. <div>
  66. Returns a clone of this LOD object and its associated distance specific objects.
  67. </div>
  68. <h2>Source</h2>
  69. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  70. </body>
  71. </html>