diff --git a/docs/examples/en/math/MeshSurfaceSampler.html b/docs/examples/en/math/MeshSurfaceSampler.html index d1d8b8310f517d6f36baedad9f84af468999d5c4..c637436b9481d32aefe0e1505b6f1c1f06e68bf5 100644 --- a/docs/examples/en/math/MeshSurfaceSampler.html +++ b/docs/examples/en/math/MeshSurfaceSampler.html @@ -17,8 +17,8 @@

Example

- // Create a sampler for a BufferGeometry surface. - var sampler = new THREE.MeshSurfaceSampler( surfaceGeometry ) + // Create a sampler for a Mesh surface. + var sampler = new THREE.MeshSurfaceSampler( surfaceMesh ) .setWeightAttribute( 'color' ) .build(); @@ -52,9 +52,9 @@

Constructor

-

[name]( [param:BufferGeometry geometry] )

+

[name]( [param:Mesh mesh] )

- [page:BufferGeometry geometry] — Surface geometry from which to sample. + [page:Mesh mesh] — Surface mesh from which to sample.

Creates a new [name]. If the input geometry is indexed, a non-indexed copy is made. After construction, the sampler is not able to return samples until [page:MeshSurfaceSampler.build build] is called. diff --git a/docs/examples/zh/math/MeshSurfaceSampler.html b/docs/examples/zh/math/MeshSurfaceSampler.html index d1d8b8310f517d6f36baedad9f84af468999d5c4..9d186032233f21878c8431f2050b11cccadb09e7 100644 --- a/docs/examples/zh/math/MeshSurfaceSampler.html +++ b/docs/examples/zh/math/MeshSurfaceSampler.html @@ -18,7 +18,7 @@ // Create a sampler for a BufferGeometry surface. - var sampler = new THREE.MeshSurfaceSampler( surfaceGeometry ) + var sampler = new THREE.MeshSurfaceSampler( surfaceMesh ) .setWeightAttribute( 'color' ) .build(); @@ -52,9 +52,9 @@

Constructor

-

[name]( [param:BufferGeometry geometry] )

+

[name]( [param:Mesh mesh] )

- [page:BufferGeometry geometry] — Surface geometry from which to sample. + [page:Mesh mesh] — Surface mesh from which to sample.

Creates a new [name]. If the input geometry is indexed, a non-indexed copy is made. After construction, the sampler is not able to return samples until [page:MeshSurfaceSampler.build build] is called. diff --git a/examples/jsm/math/MeshSurfaceSampler.js b/examples/jsm/math/MeshSurfaceSampler.js index a0c7e7364a98889e1bb572d07f51d57709df225f..20850525aa10c4ee5570f86b8520bf3a9e4647ad 100644 --- a/examples/jsm/math/MeshSurfaceSampler.js +++ b/examples/jsm/math/MeshSurfaceSampler.js @@ -20,7 +20,9 @@ var MeshSurfaceSampler = ( function () { var _face = new Triangle(); - function MeshSurfaceSampler ( geometry ) { + function MeshSurfaceSampler ( mesh ) { + + var geometry = mesh.geometry; if ( ! geometry.isBufferGeometry || geometry.attributes.position.itemSize !== 3 ) { diff --git a/examples/webgl_instancing_scatter.html b/examples/webgl_instancing_scatter.html index ff8a7d6253ac90b08ab926be759c944390f7e8d8..0b28603fe000a9cf89f0e65dd8a75d67bd834b83 100644 --- a/examples/webgl_instancing_scatter.html +++ b/examples/webgl_instancing_scatter.html @@ -181,7 +181,7 @@ console.time( '.build()' ); - sampler = new MeshSurfaceSampler( surface.geometry ) + sampler = new MeshSurfaceSampler( surface ) .setWeightAttribute( api.distribution === 'weighted' ? 'uv' : null ) .build();