Skip to content

A simple library for Gear VR 6DOF. Uses camera to track the position and the built in 3DOF tracking for rotation.

License

Unknown and 2 other licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE_cwig
GPL-3.0
LICENSE_jsyang
Notifications You must be signed in to change notification settings

WebXR-iOS/6DOF-GearVRController.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Under Attribution-NonCommercial-ShareAlike 4.0 International License
Cwig's under MIT License
Jsyang's under GPL-3.0 License

6DOF GearVR Controller Tracking

An easy way to use GearVR for more complicated use cases such as VR game that need 6DOF tracking.

How it works

  • Camera tracks colors for position tracking.
  • Gear VR controllers already have Built-in 3DOF tracking.

What you need

Software

Client Side

import { ClientTracking } from "./dist/GearVRController.js";

var tracking = new ClientTracking(codePreviewElement, threejsHandObject);

Server Side

import { ServerTracking } from "./dist/GearVRController.js";

var tracking = new ServerTracking(clientCode);

NodeJS Socket Server

const { Server } = require("socket.io");
const { createServer } = require('http');

const server = createServer(app);
const io = new Server(server);

io.on('connection', (socket) => {
    console.log('User connected ' + socket.id);

    socket.on("controllerDataOut", (id, data) => {
        socket.to(id).emit("controllerDataIn", data);
    });
    
    socket.on('disconnect', () => {
        console.log('User disconnected');
    });
});

server.listen(8080, () => {
    console.log(`Web app listening on port ${8080}`);
});

Hardware

Controller modifications

Final Controllers

Steps to reproduce

Prepare lights

  • Get 2 shuttlecocks and make sure that one is red and one is green.
  • Cut the feathers off of the shuttlecocks.
  • Remove the blue tape off both of the shuttlecocks.

Tape the lights

  • Cut off the tape into 3 bits width ways so you have 3 smaller bits of tape.
  • Tape one on one side and the other on the oppersite side of the light.
  • Finish by Wrapping the 3rd bit around the whole bottom like the blue tape was.
  • Attach both loose ends of tape to both sides of the controller.
  • Fill in the gaps with more tape making sure that none of it sticks to the controller so it is easy to turn on and off the light.
  • Repeat for the second controller.
  • You should now have 2 controllers that look simular to mine.

Final steps

  • Plug in your webcam.
  • Open the webpage in a chromium-based browser.
  • Your done!

Credits

  • CrazyH (Made this repo, added positional tracking and support for multiple controllers)
  • Huge thanks to Cwig for gearvr exploration which created the foundation for the Gear VR controller tracking.
  • Thanks to jsyang as well for creating a library that Cwig improved on.

About

A simple library for Gear VR 6DOF. Uses camera to track the position and the built in 3DOF tracking for rotation.

Resources

License

Unknown and 2 other licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE_cwig
GPL-3.0
LICENSE_jsyang

Stars

Watchers

Forks