transformModel
Applies a transformation to the specified model.
The transformation is always relative to the default model transform. This is an absolute position and zero rotation.
Example
Usage
const modelId = "my-model-id";
const transform = {
position: {
x: 1.0,
y: 1.0,
z: 0.0
},
rotation: {
centerOfRotation: {
x: 1.0,
y: 0.0,
z: 0.0
},
angle: 3.14
}
};
viewer2d.transformModel(modelId, transform);Parameters
modelId
Id of the model to transform.
Type | Required |
|---|---|
String | Yes |
transform
Transformation to apply.
Type | Required |
|---|---|
Object | Yes |
Properties
Name | Type | Required | Description |
|---|---|---|---|
position | Vector3 | No | Position to move to |
rotation | Rotation | No | Rotation transform |
Rotation
Name | Type | Required | Description |
|---|---|---|---|
angle | Number | Yes | Angle in radians |
centerOfRotation | Vector3 | Yes | Point to rotate over |