Closed jdestgermain closed 6 years ago
To rotate an object you need to use this snippet
geom.quaternion_from_rotation(
[
np.cos(alpha), -np.sin(alpha), 0,
np.sin(alpha), np.cos(alpha), 0,
0, 0, 1
])
The 'matrix' inside is a rotation matrix. wikipedia article on this
Right, but I think, quaternion_from_rotation is the method of Mesh (and similar) objects, not of geometry. So the answer is: my_mesh.quaternion_from_rotation(... as above ...)
For version 1.0, you would do this via my_mesh.quaternion
or my_mesh.rotation
. There are also the utility functions rotateX
/rotateY
/rotateZ
, lookAt
and setRotationFromMatrix
.
Closing as answered, but feel free to comment if there are anything that is not clear.
I want to rotate a cylinder I've created because it doesn't like up with other geometry in my system. I think I am missing something--this should be fairly easy.
Minimal working example of what I want:
Thanks