Transforms¶
Every YahahaObject has a Transform component, which stores and manipulates the Position, Rotation, and Scale of the object in the scene.
Transform component¶
The Transform component determines the Position, Rotation, and Scale of an object in the scene.
Property | Description |
---|---|
Position | Defines the object's location in 3D space using X, Y, and Z coordinates. Altering these values moves the object along the respective axes. |
Rotation | Determines the object's orientation around the X-, Y-, and Z- axes in degrees. Positive values denote clockwise rotations, while negative values indicate counterclockwise rotations. The default (0, 0, 0) means the object aligns with the world axes, and changing these values rotates the object around the specified axis. |
Scale | Controls the object's size along the X-, Y-, and Z-axes as a multiplier of its original size when imported into Yahaha Studio. A value of "1" represents the original size, while values above or below "1" will enlarge or shrink the object. Negative values invert the object along the specified axis. |
Editing transforms¶
Transform of single YahahaObject¶
In YAHAHA Studio (Studio), you can modify Transforms either in the Scene view or through the properties window. The Transform component displays color-coded axes: the x-axis is red, the y-axis is green, and the z-axis is blue. When you select an axis, it turns yellow for better visibility. In the Scene view, you can edit Transforms by using the Move, Rotate, and Scale tools.
After selecting a YahahaObject, select any of the following tools for further transform editing.
Move
Rotate
Point scale
Box scale
Alternatively, take the following steps to edit from the properties windows:
-
Select the YahahaObject in the scene and click the More button in the top right corner.
-
In the properties window that appears, manually adjust the Transform values.
For fast operations, you can click use the More button on the Transform pane. In the Component Menu that appears, choose to copy or paste one or all Transform values, or reset position, rotation, or scale to the default.
Transforms of multiple YahahaObjects¶
To modify the Transform properties of multiple objects at once, select objects in the scene first. In the Transform window that appears on the right side, enter the values for each property.
You can also click the More button on the component to open Component Menu, then choose to paste one or all Transform properties, or reset a property to the default.
Special case: Transforms of grouped YahahaObjects¶
In Studio, you can create parent-child relationships by grouping YahahaObjects. The Transform properties of child YahahaObjects are relative to their parents and are referred to as local coordinates. This means that a child object's position, rotation, and scale are determined in relation to the parent object's Transform.
Conversely, if a Transform has no parent object, its values will be considered global coordinates, meaning the object's position, rotation, and scale are defined in relation to the overall world space.
To better understand relative Transform properties, let's examine a bus stop 2 model from the party game template K-clubStreet: Hongdae and we'll focus on two of its child objects: bus_stop_02 and bus_stop_2_chair_1.
-
The bus stop 2 model itself has a Position value of (-177.42, 0.06, 190.38), which represents its global coordinate in world space.
-
The bus_stop_02 object has a Position value of (0, 0, 0). This is a local coordinate relative to the bus stop 2 model. When translated to world space coordinates, the child object's position is also (-177.42, 0.06, 190.38), as it shares the same position as its parent object.
-
The bus_stop_02_chair_1 object has a Position value of (-0.26, 0, -0.64). This is a local coordinate relative to the bus stop 2 model. When translated to world space coordinates, the child object's position is (-177.68, 0.06, 189.74). To find APIs related to positions, refer to YaEntity.
To find APIs related to positions, refer to YaEntity.