# Get Orientation Testing Blend

If you are having trouble with the get orientation function have a look at this.
It just shows the orientation that you can move around with the arrow keys. p prints to the console, r resets, space sets the orientation to the xyz matrix in the python script. just change the

``````
X = [1.0, 0.0, 0.0]
Y = [0.0, 1.0, 0.0]
Z = [-0.0, 0.0, 1.0]
``````

to change the orientation. then hit space in the game to set it.
Hope you understand that

edit: now you can use your mouse to move

### Attachments

Orientation Tests.blend (356 KB)

I think you have to know that if
you have an orientation matrix(as given by the “getOrientation()” method):
ori=[ [a, b, c], [d, e, f], [g, h, i] ]
Now, you have:
X=[a, d, g]
Y=[b, e, h]
Z=[c, f, i ]
Yes, it’s weird.

I think to make matrices easier to understand I think a code should be written where the matrix is converted into variables and one could tweak the variables instead of raw numbers.

Is there anyway to convert it into only 3 variables, like xrot, yrot, and zrot. this way rotation would be easy to manipulate and set.

yes, use quaternions.

So far I think the top numbers are Local and the left numbers are global

yes, use quaternions.
Trying to read the raw data isn’t worth your time. Like snowcrash said, use quaternions.

Is there anyway to convert it into only 3 variables, like xrot, yrot, and zrot. this way rotation would be easy to manipulate and set.
The problem is that you have to convert it into a 3X3 matrix anyways. If you don’t use matrices, you’ll get something called gimbal lock, which is very very very annoying.