Say that i want to convert my X rotation and Y rotation into a position in that direction.
This is how to translate my ship.position in the direction it is pointed with Transform3D:
ship.rotation_degrees.y = ry
ship.rotation_degrees.x = rx
var t = Transform3D()
t = t.rotated_local(Vector3(0,1,0), deg_to_rad(ry))
t = t.rotated_local(Vector3(1,0,0), deg_to_rad(rx))
ship.position = t.basis.z * radius
In a parallel universe where Transform3D didn't exist, how would I do the same thing without it?
here is my failed attempt at doing so, I can only get one rotation to work at a time:
ry = deg_to_rad(ry)
rx = deg_to_rad(rx)
ship.position = Vector3(sin(ry),sin(-rx),cos(ry-rx))*radius
I'm not sure how to combine the yz(rx) and the xz(ry) translation values;
t.basis.z
is only equal to Vector3(sin(ry),sin(-rx),cos(ry-rx))
when either rx or ry are 0, otherwise they are not aligned.
I'm a bit lost on how I am supposed to do this without making it overly complicated.