Skip to main content

Basic

Get started with the XR Blocks script lifecycle by interacting with a Three.js cylinder. Click on desktop, pinch with hands in XR, or use a controller trigger to dynamically change its color.

Desktop Controls (User Mode)

  • Move Camera: Use W, A, S, D to move forward, left, backward, and right.
  • Elevate Camera: Use Q and E to move down and up.
  • Rotate Camera: Right-click and drag the mouse to look around.
  • Interact: Left-click to select the object and randomize its color.

XR Controls

  • Interact: Ray-pinch with hands or pull the controller trigger to change the cylinder's color.
main.js