Rotating a 3D Matrix

Rotating a 3D Matrix
 1# This example rotates a 3D matrix by 90 degree on X axis
 2
 3# Create a local variable for the impact.creator ThreeD object
 4three_d = impact.creator.three_d()
 5
 6# Create a local variable for the output toolbox
 7ot = impact.gui.output_toolbox
 8
 9# create a default 3D matrix (Identity matrix)
10matrix = three_d.matrix3_d()
11
12# Create a vector to rotate in X axis
13vector = three_d.vector3_d(1,0,0)
14
15# Rotate the matrix by 90 degree
16call(matrix.rotate(vector, 90))
17
18# Print the rotated matrix to output toolbox
19ot.add(matrix.to_string())