I have a default 4×4 transformation matrix consist of 3×3 rotation matrix, 3×1 translation vector and 1×3 scaling vector:
matrix_default= [[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]]
I apply a translation in x-direction and visualize it using:
matrix_translated= [[1, 0, 0, 10],
[0, 1, 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]]
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.set_xlabel('X-axis')
ax.set_ylabel('Y-axis')
ax.set_zlabel('Z-axis')
# Visualize translation
ax.scatter(matrix_default[0, 3], matrix_default[1, 3], matrix_default[2, 3], color='r', s=10**2)
ax.scatter(matrix_translated[0, 3], matrix_translated[1, 3], matrix_translated[2, 3], color='black', s=10**2)
plt.show()
I want to also visualize if I apply a rotation in any direction, so that it is visualized as cartesian coordinate system on the drawn point as e.g. lines with arrows: