Code Monkey home page Code Monkey logo

webvr's Introduction

WebVR Support for PlayCanvas

The project contains scripts to run your PlayCanvas application in VR using either a Google Cardboard-style VR headset or (when using special builds of Chrome & Firefox) Oculus Rift and HTC Vive.

Requirements

For Cardboard VR any modern mobile device should work. For Oculus and Vive support you require a special build of Chromium.

How to use

  1. Make sure input_hmd.js loads first, which can be changed in Editor Settings "Scripts Loading Order".
  2. On the Entity you wish to be your camera add vrCamera to script component.
  3. By default vrCamera will start the VR mode when you click or tap the canvas.

## Options

VrCamera has a few options that are exposed on the entity in the Editor.

  • enableOnClick - If disabled you must manually call enterVr() on the camera script to start VR rendering
  • alwaysAcceptInput - If enabled HMD position tracking will be applied to the camera even if the camera is no "in VR".

Known Issues

  • Currently WebVR is a moving target, so APIs are changing often. This library now implements the WebVR 1.0 Spec.
  • Please raise an issue on this project if you encounter problems

## Attribution

input_hmd.js contains a version of the WebVR Polyfill by Boris Smus.

webvr's People

Contributors

daredevildave avatar maksims avatar

Watchers

Ewetumo Alexander avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.