[page:Object3D] →

[name]

Level of Detail - Show meshes with more or less geometry based on distance.

Example

[example:webgl_lod LOD]
var lod = new THREE.LOD(); //Create 5 levels of spheres for( var i = 0; i < 5; i++ ) { var geometry = new THREE.IcosahedronGeometry( 10, 5 - i ) new THREE.Mesh( geometry, material ); lod.addLevel( mesh, i * 50 ); }

Constructor

[name]()

Properties

[property:array levels]

An array of [page:object level] objects
level is an object with two properties.
distance -- The distance at which to display this level of detail
object -- The Object3D which will be displayed

Methods

[method:null addLevel]( [page:Object3D mesh], [page:Float distance] )

mesh -- The Object3D to display
distance -- The distance at which to display this level of detail
Adds a mesh that will display at a certain distance and greater. Typically the further away the distance, the lower the detail on the mesh.

[method:Object3D getObjectForDistance]( [page:Float distance] )

Get a reference to the first [page:Object3D] (mesh) that is greater than supplied distance.

[method:null update]( [page:Camera camera] )

camera -- The current camera
Update the visiblility of the level of detail based on the distance from the camera.

[method:LOD clone]()

Returns a clone of this LOD object and its associated distance specific objects.

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]