Develop environment
Mac book pro OSX El captain (v10.11.5)
Node ver6.1.0
About node-psvr
https://github.com/hrl7/node-psvr
What you need
- PSVR
- Mac book
Setup
Install node-psvr
$ mkdir psvr-tutorial
$ cd psvr-tutorial
$ npm init
$ npm install psvr --save
index.js
var PSVR = require("psvr");
var device = new PSVR();
device.on("data", function(data) {
console.log(data);
});
$ node index.js
{ yawAccel: 0,
pitchAccel: 0,
rollAccel: 0,
yaw: 0,
pitch: 65,
roll: 0,
xAccel: 0,
yAccel: 0,
isWorn: 0 }
{ yawAccel: 0,
pitchAccel: 0,
rollAccel: 0,
yaw: 0,
pitch: 65,
roll: -1,
xAccel: 0,
yAccel: -1,
isWorn: 0 }
{ yawAccel: -1,
pitchAccel: -1,
rollAccel: -1,
yaw: 0,
pitch: 65,
roll: -1,
xAccel: -1,
yAccel: -1,
isWorn: 0 }
※If it does not work, check your connection to PSVR or try a few times.
Next step
use three.js and watch 360 movie or
make some simple game using three.js
[node-psvr]psvrの加速度をsocket.ioでhtmlに表示してみた #PSVR