• 3D
  • 3D rotation around particular axis...

Hi everyone. Im stucked with some geometry problem here... Let's say the Ship node can navigate in any direction (dir), always facing towards its Z axis and rotating around Y.

So, considering the independent transforms, how can I rotate the "pivot for x and z" (pxz node) around an given axis perpendicular to dir? (like bending the Mast node by the wind).

The pxz node can be (or not) aligned with the Ship node, because I want the player to be abble to rotate his parent, py, which I intented to use to only rotate around Y.

Any ideas? Thanks in advance.

I would use multiple Spatial nodes in a parent-child setup. Then you can have the node you want to have offset rotations as the child of the last spatial. Then by changing the position (and rotations) of the parent spatials you can change the “pivot”, since the children nodes will be rotated when the spatial is rotated.

Hopefully that makes sense ? If not, let me know and I’ll try to better explain :)

You can do it with code, but it will be complex and unnecessary. It's best to use nested nodes. You can use Spatial as the parent holder (or multiple Spatials, if needed) which don't show up on the screen, but you can add Meshes or MeshInstance nodes inside them.

I made it with the "cascade childrends" thing. Thank you!