On 09/02/2015 at 03:58, xxxxxxxx wrote:
I have a plane.
I can get the normal vector like this:
obj = GetObjectByName("Plane")
obj_mat = obj.GetMg()
p = obj.GetPolygon(0)
points = obj.GetAllPoints()
# Get global coords of points.
p1, p2, p3 = points[p.a] * obj_mat, points[p.b] * obj_mat, points[p.c] * obj_mat
# Calc the plane normal from three of the points.
vec_normal = (p2 - p1).Cross(p3 - p1).GetNormalized()
print vec_normal
How do I get the same angle with a null oriented the same way as the plane, or straight from the plane rotation?
I tried:
obj = GetObjectByName("Plane")
obj_mat = obj.GetMg()
obj_rot_vec, w = c4d.utils.MatrixToRotAxis(obj_mat)
print obj_rot_vec
But, this didn't give me the same rotation vector. The 'w' rotation isn't needed.
I just want to get a 'normal' vector from the direction the null is pointed.
Thanks.