Skip to content

A gaze directed interface for THREE.js with a mouse-like event handling system.

License

Notifications You must be signed in to change notification settings

neuman/vreticle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vreticle

A gaze directed interface for THREE.js with an event handling system, live demo available here: http:https://neuman.github.io/vreticle/ .

This package is intended for use in webvr powered games and applications. Webvr is an upcoming standard for the delivery of virtual reality experiences through the web. However, while the standard develops there are many competing systems that must be supported to reach a wide audience, so vreticle is designed to work seamlessly with the webvr-boilerplate which supports desktop browsers, google cardboard, pure mobile accelerometers, and oculus rift (via firefox and chromium experimental builds).


How To

Include vreticle

<script src="js/deps/vreticle.js"></script>

Initialize the reticle by handing it the camera you want it attached to.

//create gaze interaction manager
var reticle = vreticle.Reticle(camera);
scene.add(camera);

Define event handler functions for your THREE.js object.

var cube = new THREE.Mesh(geometry, material);

cube.ongazelong = function(){
  this.material = reticle.get_random_hex_material();
}

cube.ongazeover = function(){
  this.material = reticle.get_random_hex_material();
}

cube.ongazeout = function(){
  this.material = reticle.default_material();
}

Add your THREE.js object to the reticle's collider list!

reticle.add_collider(cube);

And make sure to tick the reticle during your animation loop.

  reticle.reticle_loop();

About

A gaze directed interface for THREE.js with a mouse-like event handling system.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages