Using Panda3D to render ARKit Scenes

Hi, I’m having some trouble rendering my ARKit scenes in Panda3D (Python), and am having some issues due to the different orientation systems used by each 3d engine.

There’s two problems I haven’t figured out how to solve.

  1. Panda3D is Z-up RH coordinate system, ARKit is Y-Up RH Coordinate system. How do I adjust the coordinate system of the world to match ARKit? I noticed there is a getDefaultCoordinateSystem() method in panda3d.core but no accompanying setDefaultCoordinateSystem(). Is the suggested solution to do a 90 degree axis-angle rotation around the X-axis? Or is there a Better and Right way of accomplishing this?
  2. For the camera, I’m given a 3x3 matrix of camera intrinsics: OpenCV Camera Intrinsics. Is there a way for me to input the camera intrinsic matrix and build a camera?

Thanks so much :slight_smile:

As to (1), you can set that in your PRC file (or presumably in code via a call to “loadPrcFileData”), I think. You should find details in this forum post.

You can look into setting a MatrixLens on your camera, which allows you to put in an arbitrary projection matrix. However this has to be a 4x4 matrix, and I’m not familiar with the exact shape of camera intrinsic matrices.

@Thaumaturge Thanks for the info! I figured that out.

@rdb I’ll try it out.