pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

    <bdo id='PB5pQ'></bdo><ul id='PB5pQ'></ul>

<small id='PB5pQ'></small><noframes id='PB5pQ'>

        <tfoot id='PB5pQ'></tfoot>

        <i id='PB5pQ'><tr id='PB5pQ'><dt id='PB5pQ'><q id='PB5pQ'><span id='PB5pQ'><b id='PB5pQ'><form id='PB5pQ'><ins id='PB5pQ'></ins><ul id='PB5pQ'></ul><sub id='PB5pQ'></sub></form><legend id='PB5pQ'></legend><bdo id='PB5pQ'><pre id='PB5pQ'><center id='PB5pQ'></center></pre></bdo></b><th id='PB5pQ'></th></span></q></dt></tr></i><div class="uaosmio" id='PB5pQ'><tfoot id='PB5pQ'></tfoot><dl id='PB5pQ'><fieldset id='PB5pQ'></fieldset></dl></div>
      1. <legend id='PB5pQ'><style id='PB5pQ'><dir id='PB5pQ'><q id='PB5pQ'></q></dir></style></legend>

        如何定位相機以使對象在屏幕上始終具有相同的

        How to position the camera so that the object always has the same pixel width and height on the screen?(如何定位相機以使對象在屏幕上始終具有相同的像素寬度和高度?)

            <tbody id='wQXDS'></tbody>

                <legend id='wQXDS'><style id='wQXDS'><dir id='wQXDS'><q id='wQXDS'></q></dir></style></legend>

                <small id='wQXDS'></small><noframes id='wQXDS'>

                  <bdo id='wQXDS'></bdo><ul id='wQXDS'></ul>
                • <tfoot id='wQXDS'></tfoot>
                  <i id='wQXDS'><tr id='wQXDS'><dt id='wQXDS'><q id='wQXDS'><span id='wQXDS'><b id='wQXDS'><form id='wQXDS'><ins id='wQXDS'></ins><ul id='wQXDS'></ul><sub id='wQXDS'></sub></form><legend id='wQXDS'></legend><bdo id='wQXDS'><pre id='wQXDS'><center id='wQXDS'></center></pre></bdo></b><th id='wQXDS'></th></span></q></dt></tr></i><div class="a2mwcow" id='wQXDS'><tfoot id='wQXDS'></tfoot><dl id='wQXDS'><fieldset id='wQXDS'></fieldset></dl></div>
                  本文介紹了如何定位相機以使對象在屏幕上始終具有相同的像素寬度和高度?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有一個問題我不知道如何解決,也許有人可以給我一個提示.

                  I have a problem I don't know how to go about solving, maybe someone can give me a hint on how to solve it.

                  我希望將相機定位在 z 索引處,這將導致立方體以完全相同的像素寬度和高度顯示,無論窗口的大小或縱橫比是多少.立方體的 z 位置為 0.需要將相機放置在后面看這個立方體.

                  I want the camera to be positioned at a z index which will result in the cube being shown at exactly the same pixel width and height no matter what the size or aspect ratio of the window is. The cube is at a z position of 0. The camera needs to be positioned back looking at this cube.

                  因此,當用戶看到屏幕顯示時,用戶應該會在屏幕上看到具有完全相同像素寬度和高度的立方體.現在我猜測相機的z位置一定是窗口寬度、高度、縱橫比和常數的函數.

                  So when the user sees the screen display, the user should see the cube having the exact same pixel width and height on their screen. Now I guess that the camera z position must be a function of the window width, height, aspect ratio and a constant.

                  如何計算 A、B、C 和 D?我懷疑這是一個幾何問題,但我不知道如何解決它.也許我需要添加一個約束條件,即對象在匹配 100 像素寬和 100 像素高的像素中應具有完全相同的寬度和高度.

                  How can I calculate A, B, C and D? I suspect this is a geometry problem but I don't know how to go about solving it. Perhaps I need to add the constraint that the object should have exactly the same width and height in pixels matching 100 pixels wide and 100 pixels high.

                  var aspectRatio = window.innerWidth / window.innerHeight;
                  var camera = new PerspectiveCamera( 60.0, aspectRatio, 1.0, 10000.0 );
                  
                  var A = 1.0;
                  var B = 1.0;
                  var C = 1.0;
                  var D = 1.0;
                  camera.position.z = A * window.innerWidth + B * window.innerHeight +
                                      (C * aspectRatio) + D;
                  var geometry = new CubeGeometry( 100.0, 100.0, 0.0001 );
                  

                  <小時>

                  更新,我通過反復試驗解決了它.


                  Update, I solved it with trial and error.

                  我不了解這個的幾何形狀或數學,但我注意到對象的大小取決于窗口的高度,而不是取決于窗口的寬度.同樣,我不知道為什么,但是當我調整高度時,對象變得更大或更小,但是當我調整寬度時,對象保持不變.

                  I don't understand the geometry of this or the maths of this, but what I did was I noticed that the objects size was dependant on the height of the window and not dependant on the width of the window. Again, I don't know why, but when I resized the height, the object became bigger or smaller but when I resized the width the object stayed the same.

                  所以我決定高度可能是決定功能的一個元素,然后我通過改變值進行反復試驗,直到我得到正確的大小,大小為 100 x 100 像素.然后我改變了高度,它保持相同的大小.我很高興我有這個結果.

                  So I decided its likely the height is the one element which determines the function and then I used trial and error by varying values until I got it at the right size, 100 by 100 pixels in size. Then I varied the height and it stayed the same size. I'm so happy I have this result.

                  num A = 0.0;
                  num B = -0.867;
                  num C = 0.0;
                  num D = 0.0;
                  

                  推薦答案

                  在你的情況下更可能依賴于較小的窗口大小軸!因為縱橫比方程通常因情況而異:

                  In your case is more likely dependent on the smaller window size axis !!! because aspect ratio equations usually differs for cases:

                  1. 寬度>高度
                  2. 寬度 <高度

                  大多數渲染都采用了 OpenGL 的這種行為,因此您的代碼可能需要添加一個 if 才能完成 :).確保將窗口的大小調整為高度大于寬度,然后看看會發生什么

                  most renders have taken this behavior from OpenGL so may be your code needs adding one if to be complete :). To be sure just resize your window to be bigger in height then width and see what happens

                  順便說一句.背后的數學只是簡單的三角形數學,如下所示:

                  btw. the math behind is just simple triangle math like this:

                  一個 angle = 90 度 第二個是

                  atan (h1/z1) = atan (h0/z0)
                  h1/z1 = h0/z0   <- triangle similarity
                  z1 = z0*h1/h0   <- this is what you want
                  

                  在哪里:
                  h0 是控制軸的一半大小(xy)
                  h1 是立方體大小的一半
                  z0 靠近你的視錐體平面
                  z1 是立方體位置(別忘了加上立方體中心的偏移量)

                  Where:
                  h0 is your half size in control axis (x or y)
                  h1 is half cube size
                  z0 is near plane of your frustrum
                  z1 is cube position (do not forget to add the offset to center of cube)

                  所以立方體中心位置是:

                  so cube center position is:

                  z1' = (z0*h1/h0)+h1
                  

                  這篇關于如何定位相機以使對象在屏幕上始終具有相同的像素寬度和高度?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Use IScroll in Angular 2 / Typescript(在 Angular 2/Typescript 中使用 IScroll)
                  anime.js not working in Ionic 3 project(Anime.js 在 Ionic 3 項目中不起作用)
                  Ionic 3 - Update Observable with Asynchronous Data(Ionic 3 - 使用異步數據更新 Observable)
                  Angular 2: file not found on local .json file(Angular 2:在本地 .json 文件中找不到文件)
                  In Ionic 2, how do I create a custom directive that uses Ionic components?(在 Ionic 2 中,如何創建使用 Ionic 組件的自定義指令?)
                  Use ViewChild for dynamic elements - Angular 2 amp; ionic 2(將 ViewChild 用于動態元素 - Angular 2 amp;離子2)

                      <bdo id='OgFwc'></bdo><ul id='OgFwc'></ul>

                        <small id='OgFwc'></small><noframes id='OgFwc'>

                        <legend id='OgFwc'><style id='OgFwc'><dir id='OgFwc'><q id='OgFwc'></q></dir></style></legend>
                          <tbody id='OgFwc'></tbody>

                          <i id='OgFwc'><tr id='OgFwc'><dt id='OgFwc'><q id='OgFwc'><span id='OgFwc'><b id='OgFwc'><form id='OgFwc'><ins id='OgFwc'></ins><ul id='OgFwc'></ul><sub id='OgFwc'></sub></form><legend id='OgFwc'></legend><bdo id='OgFwc'><pre id='OgFwc'><center id='OgFwc'></center></pre></bdo></b><th id='OgFwc'></th></span></q></dt></tr></i><div class="zlvllnp" id='OgFwc'><tfoot id='OgFwc'></tfoot><dl id='OgFwc'><fieldset id='OgFwc'></fieldset></dl></div>
                            <tfoot id='OgFwc'></tfoot>
                            主站蜘蛛池模板: 鄂泉泵业官网|(杭州、上海、全国畅销)大流量防汛排涝泵-LW立式排污泵 | SRRC认证_电磁兼容_EMC测试整改_FCC认证_SDOC认证-深圳市环测威检测技术有限公司 | 地图标注-手机导航电子地图如何标注-房地产商场地图标记【DiTuBiaoZhu.net】 | 免费网站网址收录网_海企优网站推荐平台 | 铣刨料沥青破碎机-沥青再生料设备-RAP热再生混合料破碎筛分设备 -江苏锡宝重工 | 冰晶石|碱性嫩黄闪蒸干燥机-有机垃圾烘干设备-草酸钙盘式干燥机-常州市宝康干燥 | 高温链条油|高温润滑脂|轴承润滑脂|机器人保养用油|干膜润滑剂-东莞卓越化学 | 中国品牌门窗网_中国十大门窗品牌_著名门窗品牌 | 隔离变压器-伺服变压器--输入输出电抗器-深圳市德而沃电气有限公司 | 无压烧结银_有压烧结银_导电银胶_导电油墨_导电胶-善仁(浙江)新材料 | 防爆电机_防爆电机型号_河南省南洋防爆电机有限公司 | 洛阳装修公司-洛阳整装一站式品牌-福尚云宅装饰 | 防爆暖风机_防爆电暖器_防爆电暖风机_防爆电热油汀_南阳市中通智能科技集团有限公司 | 成都亚克力制品,PVC板,双色板雕刻加工,亚克力门牌,亚克力标牌,水晶字雕刻制作-零贰捌广告 | 东风体检车厂家_公共卫生体检车_医院体检车_移动体检车-锦沅科贸 | 焊接烟尘净化器__焊烟除尘设备_打磨工作台_喷漆废气治理设备 -催化燃烧设备 _天津路博蓝天环保科技有限公司 | 重庆网站建设,重庆网站设计,重庆网站制作,重庆seo,重庆做网站,重庆seo,重庆公众号运营,重庆小程序开发 | 深圳希玛林顺潮眼科医院(官网)│深圳眼科医院│医保定点│香港希玛林顺潮眼科中心连锁品牌 | 砖机托板价格|免烧砖托板|空心砖托板厂家_山东宏升砖机托板厂 | 软启动器-上海能曼电气有限公司 真空搅拌机-行星搅拌机-双行星动力混合机-广州市番禺区源创化工设备厂 | 杜康白酒加盟_杜康酒代理_杜康酒招商加盟官网_杜康酒厂加盟总代理—杜康酒神全国运营中心 | 体感VRAR全息沉浸式3D投影多媒体展厅展会游戏互动-万展互动 | 波纹补偿器_不锈钢波纹补偿器_巩义市润达管道设备制造有限公司 | 防腐储罐_塑料储罐_PE储罐厂家_淄博富邦滚塑防腐设备科技有限公司 | 太阳能发电系统-太阳能逆变器,控制器-河北沐天太阳能科技首页 | 酒店品牌设计-酒店vi设计-酒店标识设计【国际级】VI策划公司 | 实验室pH计|电导率仪|溶解氧测定仪|离子浓度计|多参数水质分析仪|pH电极-上海般特仪器有限公司 | 芜湖厨房设备_芜湖商用厨具_芜湖厨具设备-芜湖鑫环厨具有限公司 控显科技 - 工控一体机、工业显示器、工业平板电脑源头厂家 | 合肥仿石砖_合肥pc砖厂家_合肥PC仿石砖_安徽旭坤建材有限公司 | 除湿机|工业除湿机|抽湿器|大型地下室车间仓库吊顶防爆除湿机|抽湿烘干房|新风除湿机|调温/降温除湿机|恒温恒湿机|加湿机-杭州川田电器有限公司 | 不干胶标签-不干胶贴纸-不干胶标签定制-不干胶标签印刷厂-弗雷曼纸业(苏州)有限公司 | 合肥网络推广_合肥SEO网站优化-安徽沃龙First | 精密冲床,高速冲床等冲压设备生产商-常州晋志德压力机厂 | 档案密集架_电动密集架_移动密集架_辽宁档案密集架-盛隆柜业厂家现货批发销售价格公道 | 智能气瓶柜(大型气瓶储存柜)百科| 流量卡中心-流量卡套餐查询系统_移动电信联通流量卡套餐大全 | 三佳互联一站式网站建设服务|网站开发|网站设计|网站搭建服务商 赛默飞Thermo veritiproPCR仪|ProFlex3 x 32PCR系统|Countess3细胞计数仪|371|3111二氧化碳培养箱|Mirco17R|Mirco21R离心机|仟诺生物 | 不锈钢电动球阀_气动高压闸阀_旋塞疏水调节阀_全立阀门-来自温州工业阀门巨头企业 | 消泡剂_水处理消泡剂_切削液消泡剂_涂料消泡剂_有机硅消泡剂_广州中万新材料生产厂家 | 济南网站建设|济南建网站|济南网站建设公司【济南腾飞网络】【荐】 | 学叉车培训|叉车证报名|叉车查询|叉车证怎么考-工程机械培训网 |