LCCObject::setClipPlane
Performs plane clipping on a single LCC model.
Clipping uses the screen center as the origin. Can be used for comparison effects (e.g., swipe comparison) by comparing the two sides of the clip plane based on its direction and position.
Version Requirement
SDK v0.3.0+
Engine Support
Three.js / CesiumJS
API
LCCObject::setClipPlane(normal: number[], constant: number): void
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
normal | number[] | Yes | - | Clip plane direction, an array of length 3, e.g., [1, 0, 0]. |
constant | number | Yes | - | Distance from the clip plane to the screen center, range [-1, 1]. |
Return Value
void
Usage Example
// Clip along x-axis, centered at 0, clip left side
lccObject.setClipPlane([1, 0, 0], 0);
// Clip along x-axis, clip right side
lccObject.setClipPlane([-1, 0, 0], 0);
// Clip along y-axis, centered at 0, clip top side
lccObject.setClipPlane([0, 1, 0], 0);
// Clip along y-axis, clip bottom side
lccObject.setClipPlane([0, -1, 0], 0);
Notes
- This method can be called synchronously immediately after
LCCRender.load().
Related APIs
LCCObject::setClipBox()