Skip to content

Instantly share code, notes, and snippets.

@jeromeetienne
Created December 12, 2016 13:48
Show Gist options
  • Save jeromeetienne/2543025b0e601cc541384fecb7d9096e to your computer and use it in GitHub Desktop.
Save jeromeetienne/2543025b0e601cc541384fecb7d9096e to your computer and use it in GitHub Desktop.
StartupTHREE.js example
<script src='https://cdn.rawgit.com/jeromeetienne/startupthree.js/0.6.0/startupThree.js'></script>
startUpTHREEjs({
stats: true
}, function(demo){
// create a 3d object
var geometry = new THREE.TorusGeometry(1, 0.5)
var material = new THREE.MeshNormalMaterial()
var mesh = new THREE.Mesh(geometry, material)
// add the 3d object to the scene
demo.scene.add(mesh)
// make the object move
demo.onRenderFcts.push(function(delta){
mesh.rotation.x += Math.PI*2 * delta * 0.1
mesh.rotation.y += Math.PI*2 * delta * 0.1
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment