|
@@ -0,0 +1,89 @@
|
|
|
+<!DOCTYPE HTML>
|
|
|
+<html lang="en">
|
|
|
+ <head>
|
|
|
+ <title>three.js - spherical reflection</title>
|
|
|
+ <meta charset="utf-8">
|
|
|
+ <style type="text/css">
|
|
|
+ body {
|
|
|
+ background-color: #000000;
|
|
|
+ margin: 0px;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+
|
|
|
+ #info {
|
|
|
+ position: absolute;
|
|
|
+ top: 0px; width: 100%;
|
|
|
+ color: #ffffff;
|
|
|
+ padding: 5px;
|
|
|
+ font-family: Monospace;
|
|
|
+ font-size: 13px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ a {
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+
|
|
|
+ a:hover {
|
|
|
+ color: #0080ff;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+ </head>
|
|
|
+ <body>
|
|
|
+
|
|
|
+ <div id="container"></div>
|
|
|
+ <div id="info">
|
|
|
+ <a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - spherical reflection demo.<br />
|
|
|
+ Walt Disney head by <a href="http://www.davidoreilly.com/2009/01/walt-disneys-head-on-a-plate" target="_blank">David OReilly</a>. Reflecition texture by <a href="http://kewlers.scene.org/" target="_blank">Kewlers</a>.
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <script type="text/javascript" src="../build/Three.js"></script>
|
|
|
+ <script type="text/javascript" src="../src/extras/ImageUtils.js"></script>
|
|
|
+
|
|
|
+ <script type="text/javascript" src="obj/WaltHead.js"></script>
|
|
|
+
|
|
|
+ <script type="text/javascript">
|
|
|
+
|
|
|
+ var camera, scene, renderer,
|
|
|
+ particle1, particle2, particle2,
|
|
|
+ light1, light2, light3,
|
|
|
+ geometry, mesh;
|
|
|
+
|
|
|
+ init();
|
|
|
+ setInterval( loop, 1000 / 60 );
|
|
|
+
|
|
|
+ function init() {
|
|
|
+
|
|
|
+ var container = document.getElementById( 'container' );
|
|
|
+
|
|
|
+ camera = new THREE.Camera( 65, window.innerWidth / window.innerHeight, 1, 1000 );
|
|
|
+ camera.position.z = 100;
|
|
|
+
|
|
|
+ scene = new THREE.Scene();
|
|
|
+
|
|
|
+ geometry = new WaltHead();
|
|
|
+ geometry.computeVertexNormals();
|
|
|
+
|
|
|
+ mesh = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { env_map: ImageUtils.loadTexture( 'textures/metal.jpg', THREE.ReflectionMapping ) } ) );
|
|
|
+ mesh.overdraw = true;
|
|
|
+ scene.addObject( mesh );
|
|
|
+
|
|
|
+ renderer = new THREE.CanvasRenderer();
|
|
|
+ renderer.setSize( window.innerWidth, window.innerHeight );
|
|
|
+ container.appendChild( renderer.domElement );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ function loop() {
|
|
|
+
|
|
|
+ var time = new Date().getTime() * 0.0005;
|
|
|
+
|
|
|
+ mesh.rotation.y -= 0.01;
|
|
|
+
|
|
|
+ renderer.render(scene, camera);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ </script>
|
|
|
+ </body>
|
|
|
+</html>
|