+1 vote

I was reading the Godot documentation trying to understand 3d rotations.
I made a test scene where the yellow prism is rotated 90 degrees in the editor. I then printed the transform basis :

enter image description here

The code I used is this :

var loc_transf = $"../Camera_Mark3".transform
print(loc_transf.basis)

The result was :

((-0, 0, 1), (0, 1, 0), (-1, 0, -0))

... which seems like the wrong way around ??? It seems to me that the local X axis of the yellow prism is facing towards the negative Z, so it should be (0,0,-1). Same thing for the local Z-axis ; it faces in the direction of the positive X, so it should be (+1,0,0) ?

in Engine by (101 points)

1 Answer

+1 vote
Best answer

Basis storage is transposed, but if you use the .x, .y and .z accessors you will get the same axes you see in the editor.
See https://github.com/godotengine/godot/issues/26432

by (29,088 points)
selected by

Thanks for the link ! I understand now.

Maybe the documentation should mention this ... I'm sure others will be confused as well.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.