avatarVisionOS Blog

Summary

The web content describes the immersive space coordinate system used in Reality Composer Pro and Xcode for 3D object positioning.

Abstract

The immersive space coordinate system is defined with the origin at the user's feet, designated as (0,0,0). The X-axis represents the right direction, Y-axis the up direction, and the Z-axis the front direction, with negative values indicating the opposite directions. This coordinate system is utilized in Reality Composer Pro for placing 3D objects in a virtual space and can be manipulated programmatically in Xcode. An example is provided, demonstrating how to move an entity along the X and Z axes using Swift code, with a translation vector and a smooth transition animation over a duration of 3 seconds.

Opinions

  • The coordinate system is designed to be intuitive for developers working with 3D environments, aligning with common spatial understanding.
  • The system's compatibility with both Reality Composer Pro and Xcode suggests a seamless workflow for developers transitioning between visual and code-based 3D object manipulation.
  • The inclusion of a code example with a smooth transition (.easeInOut) indicates a preference for user-friendly motion in the immersive space, enhancing the user experience.
  • The use of SIMD3 in the code snippet reflects a focus on high-performance computing, leveraging Single Instruction, Multiple Data (SIMD) operations for efficient vector math in 3D transformations.

Immersive space coordinate system

Foot is the origin of coordinates (0,0,0).

  • X is right direction
  • Y is up direction
  • -Z is front direction
  • -X is left direction
  • -Y is bottom direction
  • Z is back direction

Note: the coordinates system can be used in Reality Composer Pro for 3D object positioning. It can also be used in Xcode to programmatically change the position of the imported 3D object. For example,

var transform = value.entity.transform
transform.translation += SIMD3(0.1, 0, -0.1)
value.entity.move(
  to: transform,
  relativeTo: nil,
  duration: 3,
  timingFunction: .easeInOut
)
Visionos
Visionpro
Coordinates
Realitykit
Xcode
Recommended from ReadMedium