LCCObject::setTranslation
Sets the translation of the LCC model.
Version Requirement
SDK v0.3.1+
Engine Support
CesiumJS
API
LCCObject::setTranslation(translation: Cesium.Cartesian3): void
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
translation | Cesium.Cartesian3 | Yes | - | Before SDK v0.6.3: WGS84 Cartesian coordinates (sets the model origin position). SDK v0.6.3+: translation in ENU coordinate system. |
Return Value
void
Usage Example
SDK v0.3.1 – v0.6.2 (WGS84 Cartesian Coordinates)
const cartesian3 = Cesium.Cartesian3.fromDegrees(118.0592, 25.5429, 52);
lccObject.setTranslation(cartesian3);
SDK v0.6.3+ (ENU Coordinate System)
Starting from v0.6.3, setTranslation performs translation in the ENU coordinate system. To set the model's origin position (WGS84 Cartesian coordinates), use setOriginPosition() instead.
const translation = new Cesium.Cartesian3(0, 0, 0);
lccObject.setTranslation(translation);
Notes
- This method must be called after the success callback of
LCCRender.load()has been triggered.
Related APIs
LCCObject::getOriginPosition()LCCObject::setOriginPosition()LCCObject::setRotation()LCCObject::setScale()