madmahen / CardboardApp.js

Create simple three.js cardboard Web app.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CardboardApp.js

This project is for Web app. To build native Android app use CardboardAppTemplate.

Simple three.js cardboard template. See demo with your phone. This demo is based on Chrome Experiments for Cardboard Example.

Template

var app = new CardboardApp();
var scene = app.scene,
  camera = app.camera,
  renderer = app.renderer;

// Add some meshes and lights to scene
...

app.on('update', function(e) {
  var state = e.detail;

  // do something on every frames
  // state.touching is true while user is touching screen
  // state.dt is delta time from previous frame
  ...
});

API

See jsdoc

About

Create simple three.js cardboard Web app.

License:MIT License


Languages

Language:HTML 47.8%Language:JavaScript 32.3%Language:CSS 19.9%