-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial Three.js stuff + css file that got left behind
- Loading branch information
Showing
3 changed files
with
934 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
var scene = new THREE.Scene(); | ||
var camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 ); | ||
|
||
var renderer = new THREE.WebGLRenderer(); | ||
renderer.setSize( window.innerWidth, window.innerHeight ); | ||
document.body.appendChild( renderer.domElement ); | ||
|
||
var geometry = new THREE.PlaneGeometry( 1, 1, 1 ); | ||
var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } ); | ||
var cube = new THREE.Mesh( geometry, material ); | ||
scene.add( cube ); | ||
|
||
camera.position.z = 5; | ||
|
||
function animate() { | ||
requestAnimationFrame( animate ); | ||
cube.rotation.x += 0.1; | ||
cube.rotation.y += 0.1; | ||
renderer.render( scene, camera ); | ||
} | ||
animate(); |
Oops, something went wrong.