LCCObject::setClipBox
Performs box clipping on a single LCC model.
Can be used to clip irregular edges of the LCC model, or to control the display/hide of local scene areas, such as height clipping.
Version Requirement
SDK v0.5.2+
Engine Support
Three.js / CesiumJS
API
LCCObject::setClipBox(param?: ClipBoxParam): void
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
param.position | { x: number, y: number, z: number } / [number, number, number] | No | - | Translate the clip box. |
param.rotation | { x: number, y: number, z: number } / [number, number, number] | No | - | Rotate the clip box, in radians. |
param.scale | { x: number, y: number, z: number } / [number, number, number] | No | - | Scale the clip box. |
param.clipSide | 1 / -1 | No | - | Clip direction. 1: clip outside the box; -1: clip inside the box. |
Return Value
void
Usage Example
Set Box Clipping
lccObject.setClipBox({
scale: { x: 1, y: 1, z: 1 }, // or [1, 1, 1]
position: { x: 0, y: 0, z: 0 }, // or [0, 0, 0]
rotation: {
x: Math.PI / 3,
y: 0,
z: 0
}, // or [Math.PI / 3, 0, 0]
clipSide: 1 // or -1
});
Clear Box Clipping
Set param to undefined to clear the current clipping.
lccObject.setClipBox(undefined);
Notes
- This method can be called synchronously immediately after
LCCRender.load().
Related APIs
LCCObject::setClipPlane()