Permalink
Browse files

Merge branch 'master' into spline

  • Loading branch information...
2 parents 8aef391 + 290e182 commit 4ff0f801084b7a1e469b27bd185259c840d72a24 @deanm committed Apr 12, 2009
View
28 demos/sphere_normals.html → demos/loader.html
@@ -1,11 +1,19 @@
<html>
-
<head>
-
-<title>pre3d demo - sphere with normals</title>
-
+<title>JavaScript 3d - Dean McNamee</title>
<style>
- canvas { margin: 3px; border: 1px dashed red; }
+ body * {
+ font-family: sans-serif;
+ font-size: 14px;
+ }
+ body.white {
+ background-color: white;
+ color: black;
+ }
+ body.black {
+ background-color: black;
+ color: white;
+ }
span.spaceyspan { margin-right: 20px; }
div.centeredDiv { text-align: center; }
li { list-style: none; }
@@ -14,13 +22,17 @@
<script src="../pre3d.js"></script>
<script src="../pre3d_shape_utils.js"></script>
<script src="demo_utils.js"></script>
-<script src="sphere_normals.js"></script>
+<script>
+window.addEventListener('load', function() {
+ var script = document.createElement('script');
+ script.src = document.location.hash.substr(1);
+ document.body.appendChild(script);
+}, false);
+</script>
</head>
<body>
-
<div id="toolbar"></div>
-
<div class="centeredDiv">
<canvas id="canvas" width="800" height="600">
Sorry, this demo requires a web browser which supports HTML5 canvas!
View
6 demos/sphere_normals.js
@@ -1,6 +1,6 @@
// (c) Dean McNamee <dean@gmail.com>. All rights reserved.
-window.addEventListener('load', function() {
+function start3d() {
var screen_canvas = document.getElementById('canvas');
var renderer = new Pre3d.Renderer(screen_canvas);
@@ -67,4 +67,6 @@ window.addEventListener('load', function() {
toolbar.populateDiv(document.getElementById('toolbar'));
ticker.start();
-}, false);
+}
+
+start3d();
View
42 demos/spin_ring.html
@@ -1,42 +0,0 @@
-<html>
-
-<head>
-
-<title>yo yo spin spin</title>
-
-<style>
- canvas { margin: 3px; border: 1px dashed red; }
- span.spaceyspan { margin-right: 20px; }
- div.centeredDiv { text-align: center; }
- li { list-style: none; }
-</style>
-
-<script src="../pre3d.js"></script>
-<script src="../pre3d_shape_utils.js"></script>
-<script src="demo_utils.js"></script>
-<script src="spin_ring.js"></script>
-</head>
-
-<body>
-
-<div id="toolbar"></div>
-
-<div class="centeredDiv">
-<canvas id="canvas" width="800" height="600">
- Sorry, this demo requires a web browser which supports HTML5 canvas!
-</canvas>
-</div>
-
-<p>
-JavaScript software 3d renderer, &copy Dean McNamee.
-</p>
-
-<ul>
- <li>Mouse &rarr; rotate around origin x and y axis.</li>
- <li>Mouse + ctrl &rarr; pan x / y.</li>
- <li>Mouse + shift &rarr; pan z.</li>
- <li>Mouse + ctrl + shift &rarr; adjust focal length.</li>
-</ul>
-
-</body>
-</html>
View
6 demos/spin_ring.js
@@ -1,6 +1,6 @@
// (c) Dean McNamee <dean@gmail.com>. All rights reserved.
-window.addEventListener('load', function() {
+function start3d() {
var screen_canvas = document.getElementById('canvas');
var renderer = new Pre3d.Renderer(screen_canvas);
@@ -80,4 +80,6 @@ window.addEventListener('load', function() {
toolbar.populateDiv(document.getElementById('toolbar'));
ticker.start();
-}, false);
+}
+
+start3d();
View
42 demos/textured_cube.html
@@ -1,42 +0,0 @@
-<html>
-
-<head>
-
-<title>pre3d demo - textured cube</title>
-
-<style>
- canvas { margin: 3px; border: 1px dashed red; }
- span.spaceyspan { margin-right: 20px; }
- div.centeredDiv { text-align: center; }
- li { list-style: none; }
-</style>
-
-<script src="../pre3d.js"></script>
-<script src="../pre3d_shape_utils.js"></script>
-<script src="demo_utils.js"></script>
-<script src="textured_cube.js"></script>
-</head>
-
-<body>
-
-<div id="toolbar"></div>
-
-<div class="centeredDiv">
-<canvas id="canvas" width="800" height="600">
- Sorry, this demo requires a web browser which supports HTML5 canvas!
-</canvas>
-</div>
-
-<p>
-JavaScript software 3d renderer, &copy Dean McNamee.
-</p>
-
-<ul>
- <li>Mouse &rarr; rotate around origin x and y axis.</li>
- <li>Mouse + ctrl &rarr; pan x / y.</li>
- <li>Mouse + shift &rarr; pan z.</li>
- <li>Mouse + ctrl + shift &rarr; adjust focal length.</li>
-</ul>
-
-</body>
-</html>
View
8 demos/textured_cube.js
@@ -89,8 +89,6 @@ function start3d(texture_image) {
ticker.start();
}
-window.addEventListener('load', function() {
- var img = new Image();
- img.onload = function() { start3d(img); };
- img.src = 'textured_cube_texture.jpg';
-}, false);
+var img = new Image();
+img.onload = function() { start3d(img); };
+img.src = 'textured_cube_texture.jpg';

0 comments on commit 4ff0f80

Please sign in to comment.