the user.getOrietation function returns a set of three three-digit sets. what are these sets? as they do not corelate with the numbers in the “n” menu.
I set an empty to each point, and I guess that each of them are a distance of one from the center in the direction of the coresponding (x,y,z) axis. But the z axis is in the opposite place I’d expect. I guess I’ll expiriment more and get a handle on it.
I began to post this before, but…
It returns a 3 by 3 matrix
(I wonder why not 4 by 4…)
well anyways behind-the-scenes blender uses matricies to deform objects. There are more efficent than the trig functions required to update the RotX RotY and RotZ values.
there is some code somewhere in the python & plugins forum to convert from that to Rot values (but it is slow, you should find a better way). I believe “euler angles” were mentioned in it.
Because it only stores orientation vectors, no position or other info.
chrisjengle, when getting individual points from the list, don’t do this:
ori = own.getOrientation()
ori_x = ori[0]
ori_y = ori[1]
ori_z = ori[2]
If you do that you’ll get incorrect values. Do this instead:
ori = own.getOrientation()
ori_x = [ ori[0][0], ori[1][0], ori[2][0] ]
ori_y = [ ori[0][1], ori[1][1], ori[2][1] ]
ori_z = [ ori[0][2], ori[1][2], ori[2][2] ]
The reason for this is because the vectors are stored like this:
[xx, yx, zx]
[xy, yy, zy]
[xz, yz, zz]
Not like this:
[xx, xy, xz]
[yx, yy, yz]
[zx, zy, zz]
I’m not sure why they’re stored this way, it seems really unintuitive to me :-?
If you’re interested in learning more about vectors, I recomend this link:
That will help alot. I already wrote a script that morphs the axil and tires of my car in strange formations, depending on the slope of the ground %| . Maybe this will help me straigten that out.