Skip to content
 
 

Latest commit

 

History

29 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Get started with VR in THREE.js... QUICK.

Latest NPM release License Dependencies Peer Dependencies

You'd probably do better just to use aframe, but if you need a way to fire up a vr scene in straight ahead THREE, this will get you going quick. DEMO

  1. Install:
npm i -S three-quickvr
  1. Use:
import QuickVR from 'three-quickvr';
import {
  BoxGeometry,
  MeshLambertMaterial,
  Mesh,
  PointLight,
  Vector3,
} from 'three';

const app = new QuickVR();

const cube = new Mesh(
  new BoxGeometry(50, 50, 50),
  new MeshLambertMaterial({color: 0xffffff})
);
cube.position.set(0, 0, -150);
app.add(cube);

const light = new PointLight(0x0000ff);
light.position.set(0, 100, 200);
app.add(light);

const axis = new Vector3(0, 1, 1);
function animation() {
  cube.rotateOnAxis(axis, -0.01);
}
app.addAnimation(animation);

the above code will look something like this:

demo

About

Get started with VR in THREE.js... QUICK.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages