{"id":3983,"date":"2017-09-27T11:27:48","date_gmt":"2017-09-27T02:27:48","guid":{"rendered":"https:\/\/fdada.info\/?page_id=3983"},"modified":"2017-11-02T10:43:25","modified_gmt":"2017-11-02T01:43:25","slug":"unit3_3d","status":"publish","type":"page","link":"https:\/\/fdada.info\/fdada\/home\/vis_3d\/unit3_3d\/","title":{"rendered":"<!--05-13-->\u539f\u5b50\u7089\u69cb\u9020\uff083\u53f7\u6a5f\uff09"},"content":{"rendered":"<style type=\"text\/css\">\r\n#view {\r\n\tfloat: left;\r\n}\r\n\r\n#c {\r\n\twidth: 750px;\r\n\theight: 750px;\r\n\tdisplay: block;\r\n}\r\n\r\n#legend {\r\n\tfloat: right;\r\n}\r\n\r\ninput.button-legend {\r\n\tmargin: 2px 2px 2px 10px;\r\n\twidth: 40px;\r\n\tcolor: #fff;\r\n\tborder-style: none;\r\n\tborder-radius: 0px;\r\n\t-moz-border-radius: 0px;\r\n\t-webkit-border-radius: 0px;\r\n}\r\n<\/style>\r\n\r\n<script type=\"text\/javascript\" src=\"\/3d\/maya\/webgl-utils.js\"><\/script>\r\n<script type=\"text\/javascript\">var DEBUG=true;<\/script>\r\n<script type=\"text\/javascript\" src=\"\/3d\/maya\/inka3d\/control.js\"><\/script>\r\n<script type=\"text\/javascript\" src=\"\/3d\/maya\/inka3d\/engine.js\"><\/script>\r\n<script type=\"text\/javascript\" src=\"\/data\/3d.models\/maya\/unit-3.js\"><\/script>\r\n\r\n<script type=\"text\/javascript\">\r\n'use strict';\r\nvar control = inka3dControl;\r\nvar engine = inka3dEngine;\r\nvar canvas;\r\nvar gl;\r\nvar renderer;\r\nvar group;\r\nvar loader;\r\nvar scene;\r\nvar sceneTime;\r\nvar input;\r\nvar cameraTargetX = -90;\r\nvar cameraTargetY = 10;\r\nvar cameraTargetZ = 45;\r\nvar cameraRotateX = -0.05;\r\nvar cameraRotateY = -0;\r\nvar cameraRotateZ = 0;\r\nvar cameraDistance = 70;\r\nvar cameraProjection = new Float32Array( [ 2.0, 1.37795, 1.41732, 0.94488, 0.0, 0.0, 0.1, 1.0e5 ] );\r\nvar startTime;\r\nvar aspect;\r\nvar viewMatrix = new Float32Array( 16 );\r\nvar projectionMatrix = new Float32Array( 16 );\r\n\r\nfunction waitLoad() {\r\n\tif ( loader.progress < 1 ) {\r\n\t\trequestAnimFrame( waitLoad );\r\n\t\tgl.clearColor( 1, 1, 1, 1 );\r\n\t\tgl.clear( gl.COLOR_BUFFER_BIT );\r\n\t\tgl.enable( gl.SCISSOR_TEST );\r\n\t\tvar w = window.innerWidth;\r\n\t\tvar h = window.innerHeight;\r\n\t\tgl.scissor( 0, h \/ 2 - 10, w * loader.progress, 20 );\r\n\t\tgl.clearColor( 0, 0, 0, 1);\r\n\t\tgl.clear( gl.COLOR_BUFFER_BIT );\r\n\t\tgl.disable( gl.SCISSOR_TEST );\r\n\t} else {\r\n\t\tinput.move = function( dx, dy ) {\r\n\t\t\tcameraRotateX += dy * 2.5;\r\n\t\t\tcameraRotateY -= dx * 2.5;\r\n\t\t};\r\n\r\n\t\tinput.scroll = function( dx, dy ) {\r\n\t\t\tcameraDistance = Math.min( Math.max( cameraDistance \/ Math.exp( 0.1 * dy \/ 9 ), 7.41976118), 74197.6172 );\r\n\t\t}\r\n\r\n\t\tinput.zoomRotate = function( zoom, rotate ) {\r\n\t\t\tcameraDistance = Math.min(Math.max( cameraDistance \/ zoom, 7.41976118 ), 74197.6172 );\r\n\t\t}\r\n\r\n\t\tstartTime = new Date().getTime() \/ 1000.0 - 0.041666666666666664;\r\n\t\ttick();\r\n\t}\r\n}\r\n\r\nfunction tick() {\r\n\trequestAnimFrame( tick );\r\n\tdrawScene();\r\n}\r\n\r\nfunction drawScene() {\r\n\tvar time = new Date().getTime() \/ 1000.0 - startTime;\r\n\tif ( time > 8.3333333333333339 ) {\r\n\t\tvar length = 8.3333333333333339 - 0.041666666666666664;\r\n\t\ttime -= length;\r\n\t\tstartTime += length;\r\n\t}\r\n\tsceneTime[ 0 ] = time;\r\n\tgroup.update();\r\n\tcontrol.cameraY( cameraTargetX, cameraTargetY, cameraTargetZ, cameraRotateX, cameraRotateY, 0, cameraDistance, viewMatrix );\r\n\tengine.matrix4x4Projection( cameraProjection, aspect, projectionMatrix );\r\n\tgl.clearColor( 1, 1, 1, 1 );\r\n\tgl.clear( gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT );\r\n\tgl.viewport( 0, 0, canvas.width, canvas.height );\r\n\tgl.enable( gl.DEPTH_TEST );\r\n\tgroup.render( viewMatrix, projectionMatrix, 'color' );\r\n}\r\n\r\nfunction resize() {\r\n\tvar width = canvas.offsetWidth;\r\n\tvar height = canvas.offsetHeight; canvas.width = width;\r\n\tcanvas.height = height; aspect = width \/ height;\r\n}\r\n\r\nfunction addAttribute( edit, caption, x ) {\r\n\tvar div = document.createElement( 'div' );\r\n\tdiv.innerHTML = caption;\r\n\tvar input = document.createElement( \"input\" );\r\n\tinput.type = \"text\";\r\n\tinput.value = x[ 0 ];\r\n\tinput.onchange = function() {\r\n\t\tx[ 0 ] = input.value;\r\n\t}\r\n\tedit.appendChild( div );\r\n\tedit.appendChild( input );\r\n}\r\n\r\nfunction webGLStart() {\r\n\tcanvas = document.getElementById( \"c\" );\r\n\tgl = WebGLUtils.setupWebGL( canvas );\r\n\tinput = new control.Input( canvas );\r\n\trenderer = new engine.Renderer( 2756 );\r\n\tgroup = renderer.createGroup();\r\n\twindow.onresize = resize;\r\n\r\n\tresize();\r\n\tloader = engine.loadEmbedded( test, '', '\/data\/3d.models\/maya\/unit-3', 0, function( container ) {\r\n\t\tif ( this.status != 0 ) {\r\n\t\t\tif ( this.status == 3 ) {\r\n\t\t\t\talert( 'WebGL error: more than ' + gl.getParameter( gl.MAX_TEXTURE_IMAGE_UNITS ) + ' texture units not supported' );\r\n\t\t\t} else {\r\n\t\t\t\tif ( this.status == 4 ) {\r\n\t\t\t\t\talert( 'WebGL error: more than ' + gl.getParameter( gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS ) + ' vertex texture units not supported' );\r\n\t\t\t\t} else if ( this.status == 5 ) {\r\n\t\t\t\t\talert( 'WebGL error: float textures not supported' );\r\n\t\t\t\t} else if ( ( this.status \/ 100 | 0 ) == 4 ) {\r\n\t\t\t\t\talert( 'HTTP error: ' + this.status );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tscene = container.createScene( \"test\", group );\r\n\t\tsceneTime = scene.getFloatVector( \"time\", 1 );\r\n\t\tvar edit = document.getElementById( \"edit\" );\r\n\t\tvar attributes = scene.getAttributes();\r\n\t\tfor ( var attribute in attributes ) {\r\n\t\t\tvar properties = attributes[ attribute ];\r\n\t\t\tif ( properties.e - properties.b == 1 ) {\r\n\t\t\t\tif ( properties.t == 0 ) {\r\n\t\t\t\t\taddAttribute( edit, attribute, scene.getIntVector( attribute, 1 ) );\r\n\t\t\t\t} else if ( properties.t == 1 ) {\r\n\t\t\t\t\taddAttribute( edit, attribute, scene.getFloatVector( attribute, 1 ) );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t} );\r\n\r\n\twaitLoad();\r\n}\r\n\r\nwindow.onload=webGLStart;\r\n\r\n<\/script>\r\n\r\n<div class=\"clear\"><\/div>\r\n\r\n<div id=\"view\">\r\n\t<canvas id=\"c\"><\/canvas>\r\n<\/div>\r\n\r\n<div id=\"legend\">\r\n<table style=\"border-style: none;\" border=\"1\">\r\n\t<tr style=\"border-style: none;\">\r\n\t\t<td style=\"border-style: none;\">\r\n\t\t\t<input type=\"button\" class=\"button-legend\" style=\"background-color:#E60012\" \/>\u4e3b\u84b8\u6c17\u914d\u7ba1<br>\r\n\t\t\t<input type=\"button\" class=\"button-legend\" style=\"background-color:#E5004F\" \/>\u7089\u5fc3\u30b9\u30d7\u30ec\u30a4(CS)\u7cfb\u914d\u7ba1<br>\r\n\t\t\t<input type=\"button\" class=\"button-legend\" style=\"background-color:#E4007F\" \/>SR\u5f01\u6392\u6c17\u7ba1<br>\r\n\t\t\t<input type=\"button\" class=\"button-legend\" style=\"background-color:#920783\" \/>\u7d66\u6c34(FDW)\u7cfb\u914d\u7ba1<br>\r\n\t\t\t<input type=\"button\" class=\"button-legend\" style=\"background-color:#1D2088\" \/>\u30b8\u30a7\u30c3\u30c8\u30dd\u30f3\u30d7<br>\r\n\t\t\t<input type=\"button\" class=\"button-legend\" style=\"background-color:#0068B7\" \/>\u518d\u5faa\u74b0(PLR)\u7cfb\u914d\u7ba1<br>\r\n\t\t\t<input type=\"button\" class=\"button-legend\" style=\"background-color:#00A0E9\" \/>\u4e3b\u84b8\u6c17\u9694\u96e2\u5f01(MSIV)<br>\r\n\t\t\t<input type=\"button\" class=\"button-legend\" style=\"background-color:#009E96\" \/>\u539f\u5b50\u7089\u9694\u96e2\u6642\u51b7\u5374(RCIC)\u7cfb\u914d\u7ba1<br>\r\n\t\t\t<input type=\"button\" class=\"button-legend\" style=\"background-color:#009944\" \/>\u518d\u5faa\u74b0(PLR)\u7cfb\u30dd\u30f3\u30d7<br>\r\n\t\t\t<input type=\"button\" class=\"button-legend\" style=\"background-color:#8FC31F\" \/>T\u30af\u30a8\u30f3\u30c1\u30e3<br>\r\n\t\t\t<input type=\"button\" class=\"button-legend\" style=\"background-color:#FFF100\" \/>\u4e3b\u84b8\u6c17\u9003\u304c\u3057\u5f01(SRV)<br>\r\n\t\t\t<input type=\"button\" class=\"button-legend\" style=\"background-color:#F39800\" \/>\u6b8b\u7559\u71b1\u9664\u53bb(RHR)\u7cfb\u914d\u7ba1<br>\r\n\t\t\t<input type=\"button\" class=\"button-legend\" style=\"background-color:#808080\" \/>\u9ad8\u5727\u7089\u5fc3\u30b9\u30d7\u30ec\u30a4(HPCI)\u7cfb\u914d\u7ba1\r\n\t\t<\/td>\r\n\t<\/tr>\r\n<\/table>\r\n<\/div>\r\n\r\n<div class=\"clear\"><\/div>\r\n","protected":false},"excerpt":{"rendered":"\u4e3b\u84b8\u6c17\u914d\u7ba1 \u7089\u5fc3\u30b9\u30d7\u30ec\u30a4(CS)\u7cfb\u914d\u7ba1 SR\u5f01\u6392\u6c17\u7ba1 \u7d66\u6c34(FDW)\u7cfb\u914d\u7ba1 \u30b8\u30a7\u30c3\u30c8\u30dd\u30f3\u30d7 \u518d\u5faa\u74b0(PLR)\u7cfb\u914d\u7ba1 \u4e3b\u84b8\u6c17\u9694\u96e2\u5f01(MSIV) \u539f\u5b50\u7089\u9694\u96e2\u6642\u51b7\u5374(RCIC)\u7cfb\u914d\u7ba1 \u518d\u5faa\u74b0(PLR)\u7cfb\u30dd\u30f3\u30d7 T\u30af\u30a8\u30f3\u30c1\u30e3 \u4e3b [&hellip;]","protected":false},"author":1,"featured_media":0,"parent":2535,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"class_list":["post-3983","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/fdada.info\/fdada\/wp-json\/wp\/v2\/pages\/3983","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fdada.info\/fdada\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/fdada.info\/fdada\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/fdada.info\/fdada\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fdada.info\/fdada\/wp-json\/wp\/v2\/comments?post=3983"}],"version-history":[{"count":4,"href":"https:\/\/fdada.info\/fdada\/wp-json\/wp\/v2\/pages\/3983\/revisions"}],"predecessor-version":[{"id":4078,"href":"https:\/\/fdada.info\/fdada\/wp-json\/wp\/v2\/pages\/3983\/revisions\/4078"}],"up":[{"embeddable":true,"href":"https:\/\/fdada.info\/fdada\/wp-json\/wp\/v2\/pages\/2535"}],"wp:attachment":[{"href":"https:\/\/fdada.info\/fdada\/wp-json\/wp\/v2\/media?parent=3983"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}