Skip to content

Instantly share code, notes, and snippets.

View caseyyee's full-sized avatar
👀
Now in (( Stereo ))

Casey Yee caseyyee

👀
Now in (( Stereo ))
View GitHub Profile
<!DOCTYPE html>
<html lang="en"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>css/vr test</title>
<meta charset="utf-8">
<script src="../../js/vrutils.js"></script>
<script type="text/javascript">
// Our VR devices -- a HMD, and its associated orientation/position sensor
@caseyyee
caseyyee / gist:c6d92b2679db20b368a9
Last active August 29, 2015 14:08
Using VRCursor
cursor = new VRCursor();
cursor.setMode('centered');
cursor.ready.then(function() {
// add cursor mesh to scene
scene.add(cursor.layout);
// init cursor
cursor.init(renderer.domElement, camera, scene);
@caseyyee
caseyyee / gist:e68104c2105c115067d1
Created November 8, 2014 01:06
Possible flicker fix
function setRenderMode(mode) {
var modes = VRClient.renderModes;
if (mode == modes.mono) {
console.log('Mono mode');
controls = new THREE.VRControls( camera );
effect = renderer;
cursor.setMode('mono');
cursor.hide();
} else if (mode == modes.stereo) {
@caseyyee
caseyyee / gist:87e108f55a1dc794a294
Created May 20, 2015 23:19
Example of iframe overflow issue
<!DOCTYPE html>
<html lang="en">
<head>
<title>CSS VR Experiments</title>
<meta charset="utf-8">
<meta name="viewmode" content="projection=stereo">
<style>
iframe {
position: absolute;
width: 100%;
@caseyyee
caseyyee / gist:e6329fdb726d21f912c1
Created May 28, 2015 19:52
Hit testing with VR DOM
<!DOCTYPE html>
<html lang="en">
<head>
<title>Blue Box</title>
<meta charset="utf-8">
<link href='http://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="lib/jquery-2.1.0.js"></script>
<script type="text/javascript" src="css-vr-utils.js"></script>
<script type="text/javascript">
@caseyyee
caseyyee / gist:aab66399bd7863257137
Last active August 29, 2015 14:22
Simple page for viewmode meta
<!DOCTYPE html>
<html lang="en">
<head>
<title>Example full VR site</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta name="viewmode" content="projection=stereo">
<meta name="theme-color" content="#efefef">
<style>
@caseyyee
caseyyee / gist:c8ea6e38d9919d3a5055
Created June 11, 2015 23:32
mozconfig for horizon
. "$topsrcdir/b2g/config/mozconfigs/common"
MOZ_HORIZON=1
mk_add_options MOZ_OBJDIR=../build
mk_add_options MOZ_MAKE_FLAGS="-j9 -s"
ac_add_options --disable-libjpeg-turbo
# This option is required if you want to be able to run Gaia's tests
@caseyyee
caseyyee / gist:8ad04bce89b1620917de
Created June 13, 2015 17:46
Error starting graphene on Windows
C:\Users\Casey\Developer\build\dist\bin>graphene.exe --start-manifest http://loc
alhost:8000 -f
JavaScript error: file:///C:/Users/Casey/Developer/build/dist/bin/components/Pro
cessGlobal.js, line 134: NS_ERROR_FILE_UNRECOGNIZED_PATH: Component returned fai
lure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsIFile.initWithPath]
*** UTM:SVC TimerManager:registerTimer - id: xpi-signature-verification
1434217537233 Marionette INFO Marionette enabled via build flag and pr
ef
[CAPI] LibOVR module is located at C:\Windows\SYSTEM32\LibOVRRT32_0_5.dll
@caseyyee
caseyyee / component.js
Created January 5, 2017 22:49
Extracting world coordinates from aframe entity
AFRAME.registerComponent('c-example', {
init: function () {
var mesh = new THREE.Mesh(new THREE.BoxGeometry( 1, 1, 1 ), new THREE.MeshLambertMaterial({color: 0xffff00}));
this.el.setObject3D('mesh', mesh);
this.calculatePosition();
},
calculatePosition: function () {
var mesh = this.el.object3D;
mesh.updateMatrixWorld();
@caseyyee
caseyyee / gist:116c44c100a9ac7844037cfd83dd9bae
Created April 13, 2017 20:23
three.js Gradient texture
//three.js r.62
var mesh, renderer, scene, camera, controls;
var t = 0, ambientFactor, canvas, textureImage;
init();
animate();
function init() {