stlviewer.html

changeset 12
b3cf0176512e
parent 11
098335a1d510
child 13
39fb313ba27c
--- a/stlviewer.html	Tue Apr 04 00:47:22 2017 +0200
+++ b/stlviewer.html	Tue Apr 04 03:13:58 2017 +0200
@@ -11,6 +11,7 @@
   		<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
 
 		<script src="https://threejs.org/build/three.js"></script>
+		<script src="https://threejs.org/examples/js/Detector.js"></script>
 		<script src="https://threejs.org/examples/js/loaders/STLLoader.js"></script>
         <script src="https://threejs.org/examples/js/controls/OrbitControls.js"></script>
 
@@ -42,10 +43,30 @@
 		<script src="stlviewer.js"></script>
 
 		<script>
+	     	if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
 			var container;
 			var camera, cameraTarget, scene, renderer;
-
-			init();
+			var m_spacer = new THREE.MeshPhongMaterial( {
+                color: 0x736f6e, specular: 0x111111, shininess: 100 } );
+ 
+/*
+				var mapHeight = new THREE.TextureLoader().load( "img/rust1.jpg" );
+				mapHeight.anisotropy = 4;
+				mapHeight.repeat.set( 0.998, 0.998 );
+				mapHeight.offset.set( 0.001, 0.001 );
+				mapHeight.wrapS = mapHeight.wrapT = THREE.RepeatWrapping;
+				mapHeight.format = THREE.RGBFormat;
+				var m_cylinder = new THREE.MeshPhongMaterial( {
+					color: 0x4682b4,
+					specular: 0x222222,
+					shininess: 25,
+					bumpMap: mapHeight,
+					bumpScale: 12
+				} );
+*/
+            var m_cylinder = new THREE.MeshPhongMaterial( {
+                color: 0x4682b4, specular: 0x111111, shininess: 200 } );
+  			init();
 			animate();
 
 		</script><div><canvas style="width: 1589px; height: 711px;" height="711" width="1589"></canvas><div style="position: fixed; top: 0px; left: 0px; cursor: pointer; opacity: 0.9; z-index: 10000;"><canvas style="width: 80px; height: 48px; display: block;" height="48" width="80"></canvas><canvas style="width: 80px; height: 48px; display: none;" height="48" width="80"></canvas></div></div>

mercurial