Move and rotate assets¶
Position coordinates¶
The world coordinate system is defined as:
- +X - forward
- +Y - right
- +Z - up
Place asset 5m forward, 3m to the right and 8m up, relative to the origin¶
asset.set_position(Vector3(5, 3, 8))
Rotation coordinates¶
The order for rotations in the coordinate system is:
- Roll - rotation around the x axis
- Pitch - rotation around the y axis
- Yaw - rotation around the z axis
Point the asset to +45 degrees around the x-axis, -30 degrees around the y-axis and 0 degrees around the z-axis¶
asset.set_rotation(Vector3(45, -30, 0))
Supported objects¶
The following objects support both manual and animated position and rotation:
A Camera that is used to view the 3D world. |
|
A camera that is set up with functions to support a satellite-based workflow. |
|
Asset class which holds the 3D model data and information. |
|
Assets which floats on water and has a buoyant physics effect. |
Animating assets¶
Assets can be animated through scenario keyframes, allowing them to vary their position and rotation across frames.
Example: animating assets¶
scenario = world.new_scenario(num_frames=10)
for i in range(scenario.num_frames):
scenario.set_keyframe(
instance=asset,
frame_id=i,
position=Vector3(i, 0, 0), # Move asset to i units along x-axis
rotation=Vector3(0, i * 2, 0), # Pitch asset to i * 2 degrees
)