8000 GitHub - servetus/three-quickvr: Get started with VR in THREE.js... QUICK.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

servetus/three-quickvr

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 91.5%
  • HTML 6.1%
  • CSS 2.4%
0