RotTo() - ZackWilde27/Z3dPy GitHub Wiki
RotTo(vRot, VTarget) simply rotates a vector, but it can also get anything's up, forward, or right vector:
Forward, Up, and Right Vectors
To get a directional vector relative to anything, plug in it's rot, and the desired direction.
# Get the forward vector of a Thing:
forward = z3dpy.RotTo(z3dpy.ThingGetRot(myThing), [0, 0, 1])
# Get the up vector of a Mesh:
up = z3dpy.RotTo(z3dpy.MeshGetRot(myMesh), [0, -1, 0])
# Get the right vector of a Mesh inside a Thing:
rot = z3dpy.VectorAdd(z3dpy.MeshGetRot(myMesh), z3dpy.ThingGetRot(myThing))
right = z3dpy.RotTo(rot, [1, 0, 0])