// Fork of xrcode.glitch.me with WebXR Layers.
// https://github.com/sigmaxipi/xrcode-1
//
// Pair a BT or USB keyboard to edit code.
// Grab with trigger to move the text field.
// Rendered on a 1080x1920 layer. Press the grip to see non-layer rendering.
let mesh;
function init() {
let geometry = new THREE.IcosahedronGeometry( 0.1 );
let material = new THREE.MeshStandardMaterial( {
roughness: 0.2, metalness: 0.5
} );
mesh = new THREE.Mesh( geometry, material );
mesh.position.set(.5, 1, -.5);
scene.add( mesh );
}
function update( time ) {
mesh.material.color.setHSL( time / 1000, 0.5, 0.5 );
mesh.position.y = Math.sin( time / 1000 ) * 0.5 + 1;
mesh.rotation.set( time / 1000, time / 2000, 0 );
}