Created
October 10, 2015 22:11
-
-
Save etyp/5cc1d5d63772a3258f81 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Meteor.isClient) { | |
Meteor.startup(function () { | |
scene = new THREE.Scene(); | |
camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 ); | |
renderer = new THREE.WebGLRenderer(); | |
renderer.setSize( window.innerWidth, window.innerHeight ); | |
document.body.appendChild( renderer.domElement ); | |
geometry = new THREE.BoxGeometry( 1, 1, 1 ); | |
material = new THREE.MeshBasicMaterial( { color: 0xffffff } ); | |
cube = new THREE.Mesh( geometry, material ); | |
scene.add( cube ); | |
camera.position.z = 5; | |
render(); | |
}); | |
} | |
render = function () { | |
requestAnimationFrame( render ); | |
cube.rotation.x += 0.01; | |
cube.rotation.y += 0.01; | |
renderer.render(scene, camera); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment