stlviewer.html

changeset 12
b3cf0176512e
parent 11
098335a1d510
child 13
39fb313ba27c
equal deleted inserted replaced
11:098335a1d510 12:b3cf0176512e
9 <link rel="stylesheet" href="stlviewer.css" /> 9 <link rel="stylesheet" href="stlviewer.css" />
10 <script src="https://code.jquery.com/jquery-1.12.4.js"></script> 10 <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
11 <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> 11 <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
12 12
13 <script src="https://threejs.org/build/three.js"></script> 13 <script src="https://threejs.org/build/three.js"></script>
14 <script src="https://threejs.org/examples/js/Detector.js"></script>
14 <script src="https://threejs.org/examples/js/loaders/STLLoader.js"></script> 15 <script src="https://threejs.org/examples/js/loaders/STLLoader.js"></script>
15 <script src="https://threejs.org/examples/js/controls/OrbitControls.js"></script> 16 <script src="https://threejs.org/examples/js/controls/OrbitControls.js"></script>
16 17
17 </head> 18 </head>
18 <body> 19 <body>
40 </div> 41 </div>
41 42
42 <script src="stlviewer.js"></script> 43 <script src="stlviewer.js"></script>
43 44
44 <script> 45 <script>
46 if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
45 var container; 47 var container;
46 var camera, cameraTarget, scene, renderer; 48 var camera, cameraTarget, scene, renderer;
47 49 var m_spacer = new THREE.MeshPhongMaterial( {
48 init(); 50 color: 0x736f6e, specular: 0x111111, shininess: 100 } );
51
52 /*
53 var mapHeight = new THREE.TextureLoader().load( "img/rust1.jpg" );
54 mapHeight.anisotropy = 4;
55 mapHeight.repeat.set( 0.998, 0.998 );
56 mapHeight.offset.set( 0.001, 0.001 );
57 mapHeight.wrapS = mapHeight.wrapT = THREE.RepeatWrapping;
58 mapHeight.format = THREE.RGBFormat;
59 var m_cylinder = new THREE.MeshPhongMaterial( {
60 color: 0x4682b4,
61 specular: 0x222222,
62 shininess: 25,
63 bumpMap: mapHeight,
64 bumpScale: 12
65 } );
66 */
67 var m_cylinder = new THREE.MeshPhongMaterial( {
68 color: 0x4682b4, specular: 0x111111, shininess: 200 } );
69 init();
49 animate(); 70 animate();
50 71
51 </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> 72 </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>
52 73
53 74

mercurial