The euler angles aren’t going to be in one line of the matrix, no. The matrix will be made by multiplying together an X rotation, a Y rotation, and a Z rotation, each of which is made of some sin/cos factors in different places.

They’re converting the euler angles to a matrix so they can apply the rotation to cam_vec.

Can someone explain what the “toMatrix” part of this code is doing? It’s python. Don’t know where the “toMatrix” function came from but I’m trying to update an old blender script.

Oh, duh, it came from mathutils. I was using a different euler function. Why to a matrix, though? I suppose because they want to end up with a matrix. Ok, so the rotation is one line of the matrix, right? which one? and will that work if I get those numbers from the matrix? I think the matrix is 4 across. There isn’t a obj.RotX anymore that I can find.

edit: there is an object.rotation_euler which gives 3 numbers. It seems repetitive, but it should work.

Never mind.

Hate 3d math.