Coder Social home page Coder Social logo

hackday17's Introduction

Accelerometer controls for Google Cardboard and Daydream!

In an effort to improve the quality of cheap VR, this was an attempt to map a user's physical motion into the VR world to give a viewer an extra degree of control. The system has 3 parts:

1. Server

A basic Node server. Largely unimportant, except for the fact that pages had to be served in order to use the VR libraries.

2. VR

VR experience was put together using two tools: three.js and StereoEffect.js by mrdoob.

3. Accelerometer Controls

OrbitalControls provided some of the functionality needed (rotational acceleration). The rest was the bulk of the project - the application grabbed linear acceleration data from the accelerometer API. The first 100 milliseconds are used as sampling data. The user is asked not to move, and all accelerometer readings are recorded. This sampling data is used to distinguish between true user motion and noise. Data with z-scores exceeding 5 in modulus (absolute value) are considered user motion. This data is stored in a vector (I custom-built the vector library for general use a while back) and integrated twice. The resulting displacement vector is used to update the user's position in the VR world.

hackday17's People

Contributors

sidlim avatar

Watchers

 avatar

Forkers

keshav919

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.