startupthree.js-example

an example of startupthree.js on jsfiddle

by jetienne

HTML

<script src='https://cdn.rawgit.com/jeromeetienne/startupthree.js/0.6.0/startupThree.js'></script>

JavaScript

startUpTHREEjs(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
	})
})