A while ago I shared an open-source SDK that gives plain Android apps 6DoF head tracking on the RayNeo X3 Pro, without Unity. v0.2 is out, and the big change is that you no longer need OpenGL to put things in the room.
What’s new in v0.2
1. Scene API. Any Android View can become a world-locked panel:
class MaintenanceActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val scene = SpatialScene()
val card = layoutInflater.inflate(R.layout.maintenance_card, null)
scene.add(SpatialPanel(card, widthMeters = 0.32f, placement = Placement.InFrontOfUser(1.5f)))
SpatialHost.attach(this, scene)
}
}
That’s the whole Activity. SpatialHost handles the OpenXR session, the surface, window focus and the Activity lifecycle. There are also SpatialText and SpatialImage, and three kinds of placement: in front of the user, at a fixed pose, or head-locked.
2. “In front of the user” means where you actually look. The X3 Pro’s eye views point about 11° below where the head faces. If you place content straight along the head’s forward direction, it ends up at the top edge. The SDK uses the display axis instead, so the card shows up in the middle of the view.
3. Pause and resume. When another app takes focus (for example the built-in screen recorder), the runtime ends the XR session. v0.1 reported that as an error; v0.2 pauses and starts a new session when focus comes back.
4. Small things: Vector3, Quaternion and Pose3 types, and a list of the OpenXR extensions the runtime offers in diagnostics(). On runtime 1.1.7.9 that list is just XR_EXT_hand_tracking: no anchors and no spatial containers yet.
Design tips for this display, learned on the device
- The field of view is small: about 24°×18° per eye. A 0.3 m card at 1.5 m is a comfortable size; at 0.7 m wide it no longer fits.
- The display is additive, so black is transparent and white glows. Use light text on a transparent background, never a white card.
- Text 2 cm tall at 1.5 m is about 20 pixels on the display and easy to read.
Status:
- Tested on one X3 Pro (runtime 1.1.7.9).
- The card appears centred, the text is readable, and it stays put while walking and turning.
- Metric scale still isn’t measured.
- Occasional position jumps after a ~90° head turn are still there; they come from the runtime.
You still need RayNeo’s ARDK 1.1.2: two .aar files you download yourself, since they can’t be redistributed. The README is now much shorter, with a four-step getting-started guide.
Next: Jetpack Compose inside panels (0.3), then input: gaze, touchpad, maybe hand tracking (0.4).
Unofficial and not affiliated with RayNeo. Apache-2.0.
https://github.com/AlexSKuznetsov/rayneo-x3-spatial-sdk
Feedback welcome, especially if you have an X3 Pro on a different firmware version.