webgl_materials_cars_anaglyph.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <title>three.js webgl - materials - cube reflection [cars]</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <style>
  8. body {
  9. background:#000;
  10. color:#fff;
  11. padding:0;
  12. margin:0;
  13. overflow:hidden;
  14. font-family:georgia;
  15. text-align:center;
  16. }
  17. h1 { }
  18. a { color:skyblue; text-decoration:none }
  19. canvas { pointer-events:none; z-index:10; position:relative; }
  20. #d { position:absolute; width: 100%; text-align:center; margin:1em 0 -4.5em 0; z-index:1000; }
  21. .bwrap { margin:0.5em 0 0 0 }
  22. button { font-family:georgia; border:0; background:#000; color:#fff; padding:0.2em 0.5em; cursor:pointer; border-radius:3px; }
  23. button:hover { background:#333 }
  24. #buttons_cars button { color:#fa0 }
  25. #car_info { text-align:center; }
  26. #car_name { font-size:1em }
  27. #car_author { font-size:1em }
  28. #oldie { background:rgb(50,0,0) !important; color:#fff !important; margin-top:7em!important }
  29. </style>
  30. </head>
  31. <body>
  32. <div id="d">
  33. <div id="info">
  34. <a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> webgl demo :
  35. texture by <a href="http://www.humus.name/index.php?page=Textures" target="_blank">Humus</a> :
  36. <span id="car_info">
  37. <span id="car_name">Bugatti Veyron model</span>
  38. by <span id="car_author"><a href="http://artist-3d.com/free_3d_models/dnm/model_disp.php?uid=1129" target="_blank">Troyano</a></span>
  39. </span>
  40. </div>
  41. <div id="buttons_cars" class="bwrap">
  42. <button id="veyron">Bugatti Veyron</button>
  43. <button id="gallardo">Lamborghini Gallardo</button>
  44. <button id="f50">Ferrari F50</button>
  45. <button id="camaro">Chevrolet Camaro</button>
  46. </div>
  47. <div id="buttons_materials" class="bwrap"></div>
  48. </div>
  49. <script src="../build/Three.js"></script>
  50. <script src="js/Detector.js"></script>
  51. <script src="js/Stats.js"></script>
  52. <script>
  53. if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
  54. var STATS_ENABLED = false;
  55. var CARS = {
  56. "veyron": {
  57. name: "Bugatti Veyron",
  58. url: "obj/veyron/VeyronNoUv_bin.js",
  59. author: '<a href="http://artist-3d.com/free_3d_models/dnm/model_disp.php?uid=1129" target="_blank">Troyano</a>',
  60. init_rotation: [ 0, 0, 0 ],
  61. scale: 5.5,
  62. init_material: 4,
  63. body_materials: [ 2 ],
  64. object: null,
  65. buttons: null,
  66. materials: null
  67. },
  68. "gallardo": {
  69. name: "Lamborghini Gallardo",
  70. url: "obj/gallardo/GallardoNoUv_bin.js",
  71. author: '<a href="http://artist-3d.com/free_3d_models/dnm/model_disp.php?uid=1711" target="_blank">machman_3d</a>',
  72. init_rotation: [ 0, 0, 0 ],
  73. scale: 3.7,
  74. init_material: 9,
  75. body_materials: [ 3 ],
  76. object: null,
  77. buttons: null,
  78. materials: null
  79. },
  80. "f50": {
  81. name: "Ferrari F50",
  82. url: "obj/f50/F50NoUv_bin.js",
  83. author: '<a href="http://artist-3d.com/free_3d_models/dnm/model_disp.php?uid=1687" target="_blank">daniel sathya</a>',
  84. init_rotation: [ 0, 0, 0 ],
  85. scale: 0.175,
  86. init_material: 2,
  87. body_materials: [ 3, 6, 7, 8, 9, 10, 23, 24 ],
  88. object: null,
  89. buttons: null,
  90. materials: null
  91. },
  92. "camaro": {
  93. name: "Chevrolet Camaro",
  94. url: "obj/camaro/CamaroNoUv_bin.js",
  95. author: '<a href="http://www.turbosquid.com/3d-models/blender-camaro/411348" target="_blank">dskfnwn</a>',
  96. init_rotation: [ 0.0, 0.0, 0.0 ],
  97. scale: 75,
  98. init_material: 0,
  99. body_materials: [ 0 ],
  100. object: null,
  101. buttons: null,
  102. materials: null
  103. }
  104. };
  105. var container, stats;
  106. var camera, scene, renderer;
  107. var m, mi;
  108. var directionalLight, pointLight;
  109. var mouseX = 0, mouseY = 0;
  110. var windowHalfX = window.innerWidth / 2;
  111. var windowHalfY = window.innerHeight / 2;
  112. var loader = new THREE.BinaryLoader( true );
  113. document.body.appendChild( loader.statusDomElement );
  114. init();
  115. animate();
  116. function init() {
  117. container = document.createElement( 'div' );
  118. document.body.appendChild( container );
  119. scene = new THREE.Scene();
  120. camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 1, 100000 );
  121. scene.add( camera );
  122. // LIGHTS
  123. var ambient = new THREE.AmbientLight( 0x555555 );
  124. scene.add( ambient );
  125. directionalLight = new THREE.DirectionalLight( 0xffffff, 2 );
  126. directionalLight.position.set( 2, 1.2, 10 ).normalize();
  127. scene.add( directionalLight );
  128. directionalLight = new THREE.DirectionalLight( 0xffffff, 1 );
  129. directionalLight.position.set( - 2, 1.2, -10 ).normalize();
  130. scene.add( directionalLight );
  131. pointLight = new THREE.PointLight( 0xffaa00, 2 );
  132. pointLight.position.set( 2000, 1200, 10000 );
  133. scene.add( pointLight );
  134. // Skybox
  135. var shader = THREE.ShaderUtils.lib[ "cube" ];
  136. shader.uniforms[ "tCube" ].texture = textureCube;
  137. var material = new THREE.ShaderMaterial( {
  138. fragmentShader: shader.fragmentShader,
  139. vertexShader: shader.vertexShader,
  140. uniforms: shader.uniforms
  141. } ),
  142. mesh = new THREE.Mesh( new THREE.CubeGeometry( 100000, 100000, 100000 ), material );
  143. mesh.flipSided = true;
  144. scene.add( mesh );
  145. //
  146. renderer = new THREE.AnaglyphWebGLRenderer();
  147. renderer.setSize( window.innerWidth, window.innerHeight );
  148. renderer.setFaceCulling( 0 );
  149. container.appendChild( renderer.domElement );
  150. if ( STATS_ENABLED ) {
  151. stats = new Stats();
  152. stats.domElement.style.position = 'absolute';
  153. stats.domElement.style.top = '0px';
  154. stats.domElement.style.zIndex = 100;
  155. container.appendChild( stats.domElement );
  156. }
  157. document.addEventListener('mousemove', onDocumentMouseMove, false);
  158. var r = "textures/cube/Bridge2/";
  159. var urls = [ r + "posx.jpg", r + "negx.jpg",
  160. r + "posy.jpg", r + "negy.jpg",
  161. r + "posz.jpg", r + "negz.jpg" ];
  162. var textureCube = THREE.ImageUtils.loadTextureCube( urls );
  163. // common materials
  164. var mlib = {
  165. "Orange": new THREE.MeshLambertMaterial( { color: 0xff6600, envMap: textureCube, combine: THREE.MixOperation, reflectivity: 0.3 } ),
  166. "Blue": new THREE.MeshLambertMaterial( { color: 0x001133, envMap: textureCube, combine: THREE.MixOperation, reflectivity: 0.3 } ),
  167. "Red": new THREE.MeshLambertMaterial( { color: 0x660000, envMap: textureCube, combine: THREE.MixOperation, reflectivity: 0.25 } ),
  168. "Black": new THREE.MeshLambertMaterial( { color: 0x000000, envMap: textureCube, combine: THREE.MixOperation, reflectivity: 0.15 } ),
  169. "White": new THREE.MeshLambertMaterial( { color: 0xffffff, envMap: textureCube, combine: THREE.MixOperation, reflectivity: 0.25 } ),
  170. "Carmine": new THREE.MeshPhongMaterial( { color: 0x770000, specular:0xffaaaa, envMap: textureCube, combine: THREE.MultiplyOperation } ),
  171. "Gold": new THREE.MeshPhongMaterial( { color: 0xaa9944, specular:0xbbaa99, shininess:50, envMap: textureCube, combine: THREE.MultiplyOperation } ),
  172. "Bronze": new THREE.MeshPhongMaterial( { color: 0x150505, specular:0xee6600, shininess:10, envMap: textureCube, combine: THREE.MixOperation, reflectivity: 0.25 } ),
  173. "Chrome": new THREE.MeshPhongMaterial( { color: 0xffffff, specular:0xffffff, envMap: textureCube, combine: THREE.Multiply } ),
  174. "Orange metal": new THREE.MeshLambertMaterial( { color: 0xff6600, envMap: textureCube, combine: THREE.MultiplyOperation } ),
  175. "Blue metal": new THREE.MeshLambertMaterial( { color: 0x001133, envMap: textureCube, combine: THREE.MultiplyOperation } ),
  176. "Red metal": new THREE.MeshLambertMaterial( { color: 0x770000, envMap: textureCube, combine: THREE.MultiplyOperation } ),
  177. "Green metal": new THREE.MeshLambertMaterial( { color: 0x007711, envMap: textureCube, combine: THREE.MultiplyOperation } ),
  178. "Black metal": new THREE.MeshLambertMaterial( { color: 0x222222, envMap: textureCube, combine: THREE.MultiplyOperation } ),
  179. "Pure chrome": new THREE.MeshLambertMaterial( { color: 0xffffff, envMap: textureCube } ),
  180. "Dark chrome": new THREE.MeshLambertMaterial( { color: 0x444444, envMap: textureCube } ),
  181. "Darker chrome":new THREE.MeshLambertMaterial( { color: 0x222222, envMap: textureCube } ),
  182. "Black glass": new THREE.MeshLambertMaterial( { color: 0x101016, envMap: textureCube, opacity: 0.975, transparent: true } ),
  183. "Dark glass": new THREE.MeshLambertMaterial( { color: 0x101046, envMap: textureCube, opacity: 0.25, transparent: true } ),
  184. "Blue glass": new THREE.MeshLambertMaterial( { color: 0x668899, envMap: textureCube, opacity: 0.75, transparent: true } ),
  185. "Light glass": new THREE.MeshBasicMaterial( { color: 0x223344, envMap: textureCube, opacity: 0.25, transparent: true, combine: THREE.MixOperation, reflectivity: 0.25 } ),
  186. "Red glass": new THREE.MeshLambertMaterial( { color: 0xff0000, opacity: 0.75, transparent: true } ),
  187. "Yellow glass": new THREE.MeshLambertMaterial( { color: 0xffffaa, opacity: 0.75, transparent: true } ),
  188. "Orange glass": new THREE.MeshLambertMaterial( { color: 0x995500, opacity: 0.75, transparent: true } ),
  189. "Orange glass 50": new THREE.MeshLambertMaterial( { color: 0xffbb00, opacity: 0.5, transparent: true } ),
  190. "Red glass 50": new THREE.MeshLambertMaterial( { color: 0xff0000, opacity: 0.5, transparent: true } ),
  191. "Fullblack rough": new THREE.MeshLambertMaterial( { color: 0x000000 } ),
  192. "Black rough": new THREE.MeshLambertMaterial( { color: 0x050505 } ),
  193. "Darkgray rough": new THREE.MeshLambertMaterial( { color: 0x090909 } ),
  194. "Red rough": new THREE.MeshLambertMaterial( { color: 0x330500 } ),
  195. "Darkgray shiny": new THREE.MeshPhongMaterial( { color: 0x000000, specular: 0x050505 } ),
  196. "Gray shiny": new THREE.MeshPhongMaterial( { color: 0x050505, shininess: 20 } )
  197. }
  198. // Gallardo materials
  199. CARS[ "gallardo" ].materials = {
  200. body: [
  201. [ "Orange", mlib[ "Orange" ] ],
  202. [ "Blue", mlib[ "Blue" ] ],
  203. [ "Red", mlib[ "Red" ] ],
  204. [ "Black", mlib[ "Black" ] ],
  205. [ "White", mlib[ "White" ] ],
  206. [ "Orange metal", mlib[ "Orange metal" ] ],
  207. [ "Blue metal", mlib[ "Blue metal" ] ],
  208. [ "Green metal", mlib[ "Green metal" ] ],
  209. [ "Black metal", mlib[ "Black metal" ] ],
  210. [ "Carmine", mlib[ "Carmine" ] ],
  211. [ "Gold", mlib[ "Gold" ] ],
  212. [ "Bronze", mlib[ "Bronze" ] ],
  213. [ "Chrome", mlib[ "Chrome" ] ]
  214. ]
  215. }
  216. m = CARS[ "gallardo" ].materials;
  217. mi = CARS[ "gallardo" ].init_material;
  218. CARS[ "gallardo" ].mmap = {
  219. 0: mlib[ "Pure chrome" ], // wheels chrome
  220. 1: mlib[ "Black rough" ], // tire
  221. 2: mlib[ "Black glass" ], // windshield
  222. 3: m.body[ mi ][ 1 ], // body
  223. 4: mlib[ "Red glass" ], // back lights
  224. 5: mlib[ "Yellow glass" ], // front lights
  225. 6: mlib[ "Dark chrome" ] // windshield rim
  226. }
  227. // Veyron materials
  228. CARS[ "veyron" ].materials = {
  229. body: [
  230. [ "Orange metal", mlib[ "Orange metal" ] ],
  231. [ "Blue metal", mlib[ "Blue metal" ] ],
  232. [ "Red metal", mlib[ "Red metal" ] ],
  233. [ "Green metal", mlib[ "Green metal" ] ],
  234. [ "Black metal", mlib[ "Black metal" ] ],
  235. [ "Gold", mlib[ "Gold" ] ],
  236. [ "Bronze", mlib[ "Bronze" ] ],
  237. [ "Chrome", mlib[ "Chrome" ] ]
  238. ],
  239. }
  240. m = CARS[ "veyron" ].materials;
  241. mi = CARS[ "veyron" ].init_material;
  242. CARS[ "veyron" ].mmap = {
  243. 0: mlib[ "Black rough" ], // tires + inside
  244. 1: mlib[ "Pure chrome" ], // wheels + extras chrome
  245. 2: m.body[ mi ][ 1 ], // back / top / front torso
  246. 3: mlib[ "Dark glass" ], // glass
  247. 4: mlib[ "Pure chrome" ], // sides torso
  248. 5: mlib[ "Pure chrome" ], // engine
  249. 6: mlib[ "Red glass 50" ], // backlights
  250. 7: mlib[ "Orange glass 50" ] // backsignals
  251. }
  252. // F50 materials
  253. CARS[ "f50" ].materials = {
  254. body: [
  255. [ "Orange", mlib[ "Orange" ] ],
  256. [ "Blue", mlib[ "Blue" ] ],
  257. [ "Red", mlib[ "Red" ] ],
  258. [ "Black", mlib[ "Black" ] ],
  259. [ "White", mlib[ "White" ] ],
  260. [ "Orange metal", mlib[ "Orange metal" ] ],
  261. [ "Blue metal", mlib[ "Blue metal" ] ],
  262. [ "Black metal", mlib[ "Black metal" ] ],
  263. [ "Carmine", mlib[ "Carmine" ] ],
  264. [ "Gold", mlib[ "Gold" ] ],
  265. [ "Bronze", mlib[ "Bronze" ] ],
  266. [ "Chrome", mlib[ "Chrome" ] ]
  267. ],
  268. }
  269. m = CARS[ "f50" ].materials;
  270. mi = CARS[ "f50" ].init_material;
  271. CARS[ "f50" ].mmap = {
  272. 0: mlib[ "Dark chrome" ], // interior + rim
  273. 1: mlib[ "Pure chrome" ], // wheels + gears chrome
  274. 2: mlib[ "Blue glass" ], // glass
  275. 3: m.body[ mi ][ 1 ], // torso mid + front spoiler
  276. 4: mlib[ "Darkgray shiny" ], // interior + behind seats
  277. 5: mlib[ "Darkgray shiny" ], // tiny dots in interior
  278. 6: m.body[ mi ][ 1 ], // back torso
  279. 7: m.body[ mi ][ 1 ], // right mirror decal
  280. 8: m.body[ mi ][ 1 ], // front decal
  281. 9: m.body[ mi ][ 1 ], // front torso
  282. 10: m.body[ mi ][ 1 ], // left mirror decal
  283. 11: mlib[ "Pure chrome" ], // engine
  284. 12: mlib[ "Darkgray rough" ], // tires side
  285. 13: mlib[ "Darkgray rough" ], // tires bottom
  286. 14: mlib[ "Darkgray shiny" ], // bottom
  287. 15: mlib[ "Black rough" ], // ???
  288. 16: mlib[ "Orange glass" ], // front signals
  289. 17: mlib[ "Dark chrome" ], // wheels center
  290. 18: mlib[ "Red glass" ], // back lights
  291. 19: mlib[ "Black rough" ], // ???
  292. 20: mlib[ "Red rough" ], // seats
  293. 21: mlib[ "Black rough" ], // back plate
  294. 22: mlib[ "Black rough" ], // front light dots
  295. 23: m.body[ mi ][ 1 ], // back torso
  296. 24: m.body[ mi ][ 1 ] // back torso center
  297. }
  298. // Camero materials
  299. CARS[ "camaro" ].materials = {
  300. body: [
  301. [ "Orange", mlib[ "Orange" ] ],
  302. [ "Blue", mlib[ "Blue" ] ],
  303. [ "Red", mlib[ "Red" ] ],
  304. [ "Black", mlib[ "Black" ] ],
  305. [ "White", mlib[ "White" ] ],
  306. [ "Orange metal", mlib[ "Orange metal" ] ],
  307. [ "Blue metal", mlib[ "Blue metal" ] ],
  308. [ "Red metal", mlib[ "Red metal" ] ],
  309. [ "Green metal", mlib[ "Green metal" ] ],
  310. [ "Black metal", mlib[ "Black metal" ] ],
  311. [ "Gold", mlib[ "Gold" ] ],
  312. [ "Bronze", mlib[ "Bronze" ] ],
  313. [ "Chrome", mlib[ "Chrome" ] ]
  314. ],
  315. }
  316. m = CARS[ "camaro" ].materials;
  317. mi = CARS[ "camaro" ].init_material;
  318. CARS[ "camaro" ].mmap = {
  319. 0: m.body[ mi ][ 1 ], // car body
  320. 1: mlib[ "Pure chrome" ], // wheels chrome
  321. 2: mlib[ "Pure chrome" ], // grille chrome
  322. 3: mlib[ "Dark chrome" ], // door lines
  323. 4: mlib[ "Light glass" ], // windshield
  324. 5: mlib[ "Gray shiny" ], // interior
  325. 6: mlib[ "Black rough" ], // tire
  326. 7: mlib[ "Fullblack rough" ], // tireling
  327. 8: mlib[ "Fullblack rough" ] // behind grille
  328. }
  329. loader.load( CARS[ "veyron" ].url, function( geometry ) { createScene( geometry, "veyron" ) } );
  330. for( var c in CARS ) initCarButton( c );
  331. }
  332. function initCarButton( car ) {
  333. $( car ).addEventListener( 'click', function() {
  334. if ( ! CARS[ car ].object ) {
  335. loader.statusDomElement.style.display = "block";
  336. loader.load( CARS[ car ].url, function( geometry ) { createScene( geometry, car ) } );
  337. } else {
  338. switchCar( car );
  339. }
  340. }, false);
  341. }
  342. function $( id ) { return document.getElementById( id ) }
  343. function button_name( car, index ) { return "m_" + car + "_" + index }
  344. function switchCar( car ) {
  345. for ( var c in CARS ) {
  346. if ( c != car && CARS[ c ].object ) {
  347. CARS[ c ].object.visible = false;
  348. CARS[ c ].buttons.style.display = "none";
  349. }
  350. }
  351. CARS[ car ].object.visible = true;
  352. CARS[ car ].buttons.style.display = "block";
  353. $( "car_name" ).innerHTML = CARS[ car ].name + " model";
  354. $( "car_author" ).innerHTML = CARS[ car ].author;
  355. }
  356. function createButtons( materials, car ) {
  357. var buttons, i, src = "";
  358. for( i = 0; i < materials.length; i ++ ) {
  359. src += '<button id="' + button_name( car, i ) + '">' + materials[ i ][ 0 ] + '</button> ';
  360. }
  361. buttons = document.createElement("div");
  362. buttons.innerHTML = src;
  363. $( "buttons_materials" ).appendChild( buttons );
  364. return buttons;
  365. }
  366. function attachButtonMaterials( materials, geometry, material_indices, car ) {
  367. for( var i = 0; i < materials.length; i ++ ) {
  368. $( button_name( car, i ) ).counter = i;
  369. $( button_name( car, i ) ).addEventListener( 'click', function() {
  370. for ( var j = 0; j < material_indices.length; j ++ ) {
  371. geometry.materials[ material_indices [ j ] ] = materials[ this.counter ][ 1 ];
  372. }
  373. }, false );
  374. }
  375. }
  376. function createScene( geometry, car ) {
  377. loader.statusDomElement.innerHTML = "Creating model ...";
  378. var m = new THREE.MeshFaceMaterial(),
  379. s = CARS[ car ].scale * 1,
  380. r = CARS[ car ].init_rotation,
  381. materials = CARS[ car ].materials,
  382. mi = CARS[ car ].init_material,
  383. bm = CARS[ car ].body_materials;
  384. for( var i in CARS[ car ].mmap ) {
  385. geometry.materials[ i ] = CARS[ car ].mmap[ i ];
  386. }
  387. var mesh = new THREE.Mesh( geometry, m );
  388. mesh.rotation.x = r[ 0 ];
  389. mesh.rotation.y = r[ 1 ];
  390. mesh.rotation.z = r[ 2 ];
  391. mesh.scale.x = mesh.scale.y = mesh.scale.z = s;
  392. scene.add( mesh );
  393. CARS[ car ].object = mesh;
  394. CARS[ car ].buttons = createButtons( materials.body, car );
  395. attachButtonMaterials( materials.body, geometry, bm, car );
  396. switchCar( car );
  397. loader.statusDomElement.style.display = "none";
  398. loader.statusDomElement.innerHTML = "Loading model ...";
  399. }
  400. function onDocumentMouseMove(event) {
  401. mouseY = ( event.clientY - window.innerHeight );
  402. }
  403. //
  404. function animate() {
  405. requestAnimationFrame( animate );
  406. render();
  407. }
  408. function render() {
  409. var timer = -0.0002 * Date.now();
  410. camera.position.y += ( - mouseY - camera.position.y ) * .05;
  411. camera.position.x = 1000 * Math.cos( timer );
  412. camera.position.z = 1000 * Math.sin( timer );
  413. camera.lookAt( scene.position );
  414. renderer.render( scene, camera );
  415. if ( STATS_ENABLED ) stats.update();
  416. }
  417. </script>
  418. </body>
  419. </html>