Skip to content

Instantly share code, notes, and snippets.

@pyrobot
Created April 26, 2013 04:43
Show Gist options
  • Save pyrobot/5465072 to your computer and use it in GitHub Desktop.
Save pyrobot/5465072 to your computer and use it in GitHub Desktop.
# 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