Rotate and move entity same as windows move and rotate in visionOS

Hi!

I am making an app where I have a scene with main entity in immersive space. Since my entity is fixed in space I added a reposition entity that allows users to reposition the whole entity in space. I use the drag gesture and translation to move the whole entity in x, y and z coordinates.

I wanted to implement the same behaviour that we have when we drag the window bar in visionOS windows. I tried using basic trigonometry and calculate entity rotation and translation relative to the movement but I am not getting the same movement and rotation as in visionOS windows.

Does anybody have a working solution for this? I would appreaciate it a lot. :)

Replies

Hi, please refer to Transforming RealityKit entities using gestures.

  • I tried that the other day but did not work. I will try again and see if I did something wrong because sample code app was no working as described in the info. 😕

Add a Comment