Skip to content

Examples

Josh Stovall edited this page Dec 19, 2020 · 4 revisions

A few quick examples.

Adding objects live demo

import * as XR from '/XR.js';

var reality = new XR.Reality();

// add objects
var floor = new XR.Floor();
var box   = new XR.Box();

Hand Tracking live demo

import * as XR from '/XR.js';

var reality = new XR.Reality();

// setup hands
var hand = new XR.Hands();

// left hand
var left = hand.left;

// right hand
var right = hand.right;

Lighting live demo

import * as XR from '/XR.js';

new XR.Reality();

// basic light
new XR.Light();

// green spotlight
new XR.Light({
    color:'green',
    type:'spot'
});

Live demo

Go to https://xrjs.dev/examples/ to try the live demos.

Clone this wiki locally