2
0
Эх сурвалжийг харах

Exited Example to use file include rather than inline hilbert3D definition

thorsummoner 11 жил өмнө
parent
commit
92814d4359

+ 1 - 42
examples/canvas_lines_colors.html

@@ -48,6 +48,7 @@
 
 		<script src="js/Detector.js"></script>
 		<script src="js/libs/stats.min.js"></script>
+		<script src="js/geometries/hilbert3D.js"></script>
 
 		<script>
 
@@ -143,48 +144,6 @@
 
 			}
 
-			// port of Processing Java code by Thomas Diewald
-			// http://www.openprocessing.org/visuals/?visualID=15599
-
-			function hilbert3D( center, side, iterations, v0, v1, v2, v3, v4, v5, v6, v7 ) {
-
-				var half = side / 2,
-
-					vec_s = [
-
-					new THREE.Vector3( center.x - half, center.y + half, center.z - half ),
-					new THREE.Vector3( center.x - half, center.y + half, center.z + half ),
-					new THREE.Vector3( center.x - half, center.y - half, center.z + half ),
-					new THREE.Vector3( center.x - half, center.y - half, center.z - half ),
-					new THREE.Vector3( center.x + half, center.y - half, center.z - half ),
-					new THREE.Vector3( center.x + half, center.y - half, center.z + half ),
-					new THREE.Vector3( center.x + half, center.y + half, center.z + half ),
-					new THREE.Vector3( center.x + half, center.y + half, center.z - half )
-
-					],
-
-					vec = [ vec_s[ v0 ], vec_s[ v1 ], vec_s[ v2 ], vec_s[ v3 ], vec_s[ v4 ], vec_s[ v5 ], vec_s[ v6 ], vec_s[ v7 ] ];
-
-				if( --iterations >= 0 ) {
-
-					var tmp = [];
-
-					Array.prototype.push.apply( tmp, hilbert3D ( vec[ 0 ], half, iterations, v0, v3, v4, v7, v6, v5, v2, v1 ) );
-					Array.prototype.push.apply( tmp, hilbert3D ( vec[ 1 ], half, iterations, v0, v7, v6, v1, v2, v5, v4, v3 ) );
-					Array.prototype.push.apply( tmp, hilbert3D ( vec[ 2 ], half, iterations, v0, v7, v6, v1, v2, v5, v4, v3 ) );
-					Array.prototype.push.apply( tmp, hilbert3D ( vec[ 3 ], half, iterations, v2, v3, v0, v1, v6, v7, v4, v5 ) );
-					Array.prototype.push.apply( tmp, hilbert3D ( vec[ 4 ], half, iterations, v2, v3, v0, v1, v6, v7, v4, v5 ) );
-					Array.prototype.push.apply( tmp, hilbert3D ( vec[ 5 ], half, iterations, v4, v3, v2, v5, v6, v1, v0, v7 ) );
-					Array.prototype.push.apply( tmp, hilbert3D ( vec[ 6 ], half, iterations, v4, v3, v2, v5, v6, v1, v0, v7 ) );
-					Array.prototype.push.apply( tmp, hilbert3D ( vec[ 7 ], half, iterations, v6, v5, v2, v1, v0, v3, v4, v7 ) );
-
-					return tmp;
-
-				}
-
-				return vec;
-			}
-
 			//
 
 			function onDocumentMouseMove( event ) {