Camera¶
SwitchCameraTo3D¶
Viewpoint switch between 3D and 2D.
Note
Same as 3D/2D switch button in control panel
| Name | Required | Default | Description |
|---|---|---|---|
| enable | No | true |
If true, switch to 3D, if false, switch to 2D |
CameraFitToSelection¶
Fit to selected object, if no object is selected, fit to current layer.
Parameters
No parameters.
Example
1 2 3 | {
"cmd": "CameraFitToSelection"
}
|
SetOrbitCameraParam¶
Camera parameters setting.
| Name | Required | Default | Description |
|---|---|---|---|
| heightLimit | No | [0,1500] |
Height limit setting, take two array as input, first array as minimum height, second array as maxium height. |
| zoomLimit | No | [0.1,1000] |
Limits on back and froths moving through mouse wheel. take one array as input, first element in array sets closest distance to viewpoint, second viewpoint sets farthest distance from viewpoint. |
| farClipDistance | No | change with height attribute | Far clip distance setting, for animation effects only |
| nearClipDistance | No | change with height attribute | Near clip distance setting, for animation effects only |
| smooth | No | true |
Flying camera in smooth mode, if set to false, camera will fly straight. |
Example
1 2 3 4 5 6 7 8 | {
"cmd": "SetOrbitCameraParam",
"heightLimit":[0, 5500],
"zoomLimit":[0, 15500],
"farClipDistance":5000,
"nearClipDistance":0.2,
"smooth":true
}
|
CameraFlyToBest¶
Fly to optimized viewpoint of given object.
Note
Only accept one object as input
| Name | Required | Default | Description |
|---|---|---|---|
| Object Reference | Yes | Object Reference | |
| time | No | 2 | Fly time, in seconds |
| offset | No | [0,0,0] |
Optimized viewpoint plus offset as camera location. Note Offset is calculated in world coordinate. |
Example
1 2 3 4 5 6 | {
"cmd": "CameraFlyToBest",
"uid":"object01",
"time":3,
"offset":[0.0, 1.0, 0.0] //move up another 1 meter.
}
|
CameraFitToBest¶
Move camera to optimized viewpoint of given object, no flying process.
Note
Only accept one object as input
| Name | Required | Default | Description |
|---|---|---|---|
| Object Reference | Yes | Object Reference | |
| time | No | 2 | Fly time, in seconds |
| offset | No | [0,0,0] |
Optimized viewpoint plus offset as camera location. Note Offset is calculated in world coordinate. |
Example
1 2 3 4 5 6 | {
"cmd": "CameraFitToBest",
"uid":"object01",
"time":3,
"offset":[0.0, 1.0, 0.0] //move up another 1 meter.
}
|