Capítulo 571 de 859
A marching cubes implementation.
Port of: http://webglsamples.org/blob/blob.html
import { MarchingCubes } from 'three/addons/objects/MarchingCubes.js';
Constructor
| Signature |
|---|
new MarchingCubes( resolution : number, material : Material, enableUvs : boolean, enableColors : boolean, maxPolyCount : number ) |
Properties
| Property | Description |
|---|---|
.enableColors : boolean | Whether colors should be animated or not. |
.enableUvs : boolean | Whether texture coordinates should be animated or not. |
.isMarchingCubes : boolean (readonly) | This flag can be used for type testing. |
Methods
| Method | Description |
|---|---|
.addBall( ballx : number, bally : number, ballz : number, strength : number, subtract : number, colors : Color ) | Adds a reciprocal ball (nice and blobby) that, to be fast, fades to zero after a fixed distance, determined by strength and subtract. |
.addPlaneX( strength : number, subtract : number ) | Adds a plane along the x-axis. |
.addPlaneY( strength : number, subtract : number ) | Adds a plane along the y-axis. |
.addPlaneZ( strength : number, subtract : number ) | Adds a plane along the z-axis. |
.blur( intensity : number ) | Applies a blur with the given intensity. |
.getCell( x : number, y : number, z : number ) : number | Returns the cell value for the given coordinates. |
.reset() | Resets the effect. |
.setCell( x : number, y : number, z : number, value : number ) | Sets the cell value for the given coordinates. |
.update() | Updates the effect. |