Vector3 vector = new Vector3(1, 2, 3); Vector3 scaledVector = vector * 2;
Vector3 vector = new Vector3(1, 0, 0); Quaternion rotation = Quaternion.Euler(0, 0, 90); Vector3 rotatedVector = rotation * vector;
Matrix4x4 matrix1 = Matrix4x4.identity; Matrix4x4 matrix2 = Matrix4x4.Rotate(Quaternion.Euler(0, 90, 0)); Matrix4x4 result = matrix1 * matrix2;This code creates two 4x4 matrices: the identity matrix and a rotation matrix that rotates around the Y-axis by 90 degrees. It then multiplies the two matrices to get a new transformation matrix. This example uses the Matrix4x4 struct from the UnityEngine package. All of these examples use the Transform library from the UnityEngine package, which is a part of Unity game engine.