Compass 3D Sensors Example

               
by
Published Sep 6, 2026 at 17:05
Open In Editor


DeviceOrientationCameraAbs Cross-platform absolute North sensor.

  • Added a unified "Force Absolute North" toggle.
  • Uses deviceorientationabsolute to wake the Android magnetometer.
  • Applies a smoothed webkitCompassHeading offset for iOS to prevent jitter.
  • Includes real-time telemetry ports (Has Absolute North, North Mode).

MotionSensorAbs Fluid camera aligned to North.

  • Inherits the hybrid absolute North logic for synchronized 3D viewing.
  • Retains core quaternion math to handle W3C coordinate remapping.
  • Fixed iOS performance drops by removing requestPermission from the 60fps render loop.

Compass3D Gimbal-lock-free stable compass heading.

  • Extracts a continuous heading regardless of device pitch or roll.
  • Bypasses Euler angle vertical gimbal lock using Quaternions.
  • Automatically interpolates the aiming axis between the device's top edge and rear camera based on 3D screen tilt.

Licence: Public Domain Dedication

Commercial use ok, freely remix, reuse this work without restriction, please credit the author.
 



More patches made by cables users





what is cables?


Cables is a tool for creating beautiful interactive content. With an easy to navigate interface and real time visuals, it allows for rapid prototyping and fast adjustments.

cables is free to use!

Register