0

I'm trying to use an ARView in a macOS-only project. I can load a scene (tested with a Reality file from Reality Composer), and it renders fine.

But how do I control the camera with the mouse?

An example of this is Reality Composer, Reality Converter, and previewing a Reality file in Xcode where you can drag anywhere on the view and the camera pans, rotates, etc. In SceneKit the equivalent is allowsCameraControl

  • There's no cameraMode on the macOS ARView, probably because it only supports nonAR anyway.

  • I tried adding a PerspectiveCamera hoping it would unlock interactivity, but no luck.

I guess I could just implement all the gestures myself, but that's a lot of work, and Apple seems to be using a standard way to interact with the scene with a mouse - and also a standard grid, which I'd love to use, too.

I'm using macOS 12 beta 1, but it shouldn't make a big difference since ARView requires macOS 10.15

Andy Jazz
  • 36,357
  • 13
  • 107
  • 175
Morten J
  • 724
  • 9
  • 18

1 Answers1

0

Neither in macOS nor in iOS, RealityKit has a property similar to SceneKit's .allowsCameraControl. However, using this code as a starting point, you can create your own camera control in RealityKit.

This post can also be helpful for you.

Andy Jazz
  • 36,357
  • 13
  • 107
  • 175