I want to use python to rotate an object around an arbitrary axis. I’ve read The Matrix and Quaternions FAQ, but I need more help. This is how to do it with POV-Ray:

```
#local VX = vnormalize(V); // assuming that V is the axis of rotation
#local VY = vnormalize(vcross(VX,<VX.y,VX.z,-VX.x>));
#local VZ = vnormalize(vcross(VX,VY));
object { MyObject
matrix < VX.x,VY.x,VZ.x,
VX.y,VY.y,VZ.y,
VX.z,VY.z,VZ.z,
0, 0, 0 >
rotate x*Angle // here Angle is your angle of rotation
matrix < VX.x,VX.y,VX.z,
VY.x,VY.y,VY.z,
VZ.x,VZ.y,VZ.z,
0, 0, 0 >
}
```

To do it with Blender, I need 2 functions: matrix2euler() and euler2matrix() because Blender will not let you directly assign a transformation matrix to an object.

Does anyone have a python function that returns the final rotation matrix for an object rotated around an arbitrary axis? Eeshlo did some work in this area and I hope he has some suggestions.