How do I get an object's orientation with respect to the world axes?
I thought I could do this with a tag but it seems that the tag's orientation data is relative to the object, i.e. local. You can see this because when opening the tag tweak, the gizmo appears to set up the axes how you wish.
Is there a way to get my world space orientation? I can't find it.
-
I think the tag method will do what you want it to. You want the axes relative to how the object is facing, right? So you want those axes to move and rotate as the object does. That's what the tag is doing.
What do you want to use this for? Perhaps I can get a better understanding of what you're trying to do with more context. -
The tag is telling me how the object is rotating around it's own axes. Those axes are local to the object and move with it, as you say. I want to know how the object is rotating around the world axes, regardless of it's local orientation.
I want this data to implement a particular control method for a flying vehicle. The vehicle is controls its rotation with the 'camera relative' Left Stick (the page 2 one on the Controller Sensor), therefore I don't care how it's rotating around it's own local axes, because I'm not controlling that.
When I push forward and back on my left stick, the object rotates around the 'world' X axis, whatever it's local orientation may be. Likewise, when I push left and right, the vehicle rotates around the world z axis. In other words, the rotators on the vehicle are set to world, not local.
So, as the vehicle controls relative to the world axis, it would very useful to know my rotations, relative to the world axis. In this situation the local rotation data is not very useful...or at least not unless I go through a lot of logic to try and manually convert it into 'world' relative data. I wondered if there's an easier way for me to get those rotations.
Iniciar sesión para dejar un comentario.