Created
April 26, 2013 04:43
-
-
Save pyrobot/5465072 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
# get container | |
container = document.getElementById "container" | |
# create renderer and add to container | |
renderer = new THREE.WebGLRenderer | |
renderer.setSize container.offsetWidth, container.offsetHeight | |
container.appendChild renderer.domElement | |
# create the scene and camera | |
scene = new THREE.Scene | |
camera = new THREE.PerspectiveCamera 45, | |
container.offsetWidth / container.offsetHeight, 1, 4000 | |
camera.position.set 0, 0, 3.333 | |
scene.add camera | |
# create a new mesh | |
geometry = new THREE.PlaneGeometry 1, 1 | |
mesh = new THREE.Mesh geometry, new THREE.MeshBasicMaterial | |
scene.add mesh | |
# render it | |
renderer.render scene, camera | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment