3
$\begingroup$

How can I rotate Vector/Point with python? Could you help me guys? Here is screenshot:

enter image description here

On the left - normalized vectors. I need to rotate according to UpVectopr. On the right - non-normalized UpVector and a point. I need to rotate a point with UpVector.

How can this be done?

$\endgroup$
7
$\begingroup$

A vector has a rotate function - see mathutils.Vector.rotate

vec = mathutils.Vector((0.0, 1.0, 2.0))
eul = mathutils.Euler((0.0, math.radians(45.0), 0.0), 'XYZ')
vec.rotate(eul)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.