Permalink
Browse files

porting demo using js file from github directly

  • Loading branch information...
1 parent db3460e commit 79cf6d945584072b8f07a44a44944d522f88de4f @jeromeetienne committed Aug 11, 2013
@@ -24,10 +24,10 @@
<body>
<div id="info"><a href="/blog/2011/08/06/lets-do-a-cube/" target="_blank">LearningThree.js</a> - Lets do a cube demo</div>
<!-- include javascript files -->
- <script type="text/javascript" src="https://raw.github.com/mrdoob/three.js/r44/build/Three.js"></script>
- <script type="text/javascript" src="https://raw.github.com/mrdoob/three.js/r44/examples/js/RequestAnimationFrame.js"></script>
- <script type="text/javascript" src="https://raw.github.com/mrdoob/three.js/r44/examples/js/Detector.js"></script>
- <script type="text/javascript" src="https://raw.github.com/mrdoob/three.js/r44/examples/js/Stats.js"></script>
+ <script type="text/javascript" src="vendor/three.js/build/Three.js"></script>
+ <script type="text/javascript" src="vendor/three.js/examples/js/RequestAnimationFrame.js"></script>
+ <script type="text/javascript" src="vendor/three.js/examples/js/Detector.js"></script>
+ <script type="text/javascript" src="vendor/three.js/examples/js/Stats.js"></script>
<script type="text/javascript" src="lets_do_a_cube.js"></script>
</body>
</html>

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,58 @@
+/**
+ * @author alteredq / http://alteredqualia.com/
+ * @author mr.doob / http://mrdoob.com/
+ */
+
+Detector = {
+
+ canvas : !! window.CanvasRenderingContext2D,
+ webgl : ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )(),
+ workers : !! window.Worker,
+ fileapi : window.File && window.FileReader && window.FileList && window.Blob,
+
+ getWebGLErrorMessage : function () {
+
+ var domElement = document.createElement( 'div' );
+
+ domElement.style.fontFamily = 'monospace';
+ domElement.style.fontSize = '13px';
+ domElement.style.textAlign = 'center';
+ domElement.style.background = '#eee';
+ domElement.style.color = '#000';
+ domElement.style.padding = '1em';
+ domElement.style.width = '475px';
+ domElement.style.margin = '5em auto 0';
+
+ if ( ! this.webgl ) {
+
+ domElement.innerHTML = window.WebGLRenderingContext ? [
+ 'Your graphics card does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation">WebGL</a>.<br />',
+ 'Find out how to get it <a href="http://get.webgl.org/">here</a>.'
+ ].join( '\n' ) : [
+ 'Your browser does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation">WebGL</a>.<br/>',
+ 'Find out how to get it <a href="http://get.webgl.org/">here</a>.'
+ ].join( '\n' );
+
+ }
+
+ return domElement;
+
+ },
+
+ addGetWebGLMessage : function ( parameters ) {
+
+ var parent, id, domElement;
+
+ parameters = parameters || {};
+
+ parent = parameters.parent !== undefined ? parameters.parent : document.body;
+ id = parameters.id !== undefined ? parameters.id : 'oldie';
+
+ domElement = Detector.getWebGLErrorMessage();
+ domElement.id = id;
+
+ parent.appendChild( domElement );
+
+ }
+
+};
@@ -0,0 +1,22 @@
+/**
+ * Provides requestAnimationFrame in a cross browser way.
+ * http://paulirish.com/2011/requestanimationframe-for-smart-animating/
+ */
+
+if ( !window.requestAnimationFrame ) {
+
+ window.requestAnimationFrame = ( function() {
+
+ return window.webkitRequestAnimationFrame ||
+ window.mozRequestAnimationFrame ||
+ window.oRequestAnimationFrame ||
+ window.msRequestAnimationFrame ||
+ function( /* function FrameRequestCallback */ callback, /* DOMElement Element */ element ) {
+
+ window.setTimeout( callback, 1000 / 60 );
+
+ };
+
+ } )();
+
+}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -25,10 +25,10 @@
<body>
<div id="info"><a href="/blog/2011/08/15/lets-do-a-sky/" target="_blank">LearningThree.js</a> - Lets do a sky demo</div>
<!-- include javascript files -->
- <script type="text/javascript" src="https://raw.github.com/mrdoob/three.js/r44/build/Three.js"></script>
- <script type="text/javascript" src="https://raw.github.com/mrdoob/three.js/r44/examples/js/RequestAnimationFrame.js"></script>
- <script type="text/javascript" src="https://raw.github.com/mrdoob/three.js/r44/examples/js/Detector.js"></script>
- <script type="text/javascript" src="https://raw.github.com/mrdoob/three.js/r44/examples/js/Stats.js"></script>
+ <script type="text/javascript" src="vendor/three.js/build/Three.js"></script>
+ <script type="text/javascript" src="vendor/three.js/examples/js/RequestAnimationFrame.js"></script>
+ <script type="text/javascript" src="vendor/three.js/examples/js/Detector.js"></script>
+ <script type="text/javascript" src="vendor/three.js/examples/js/Stats.js"></script>
<script type="text/javascript" src="lets_do_a_sky.js"></script>
</body>
</html>
Oops, something went wrong.

0 comments on commit 79cf6d9

Please sign in to comment.