three.js 源碼注釋(二十九)Cameras/OrthographicCamera.js,orthographiccamera

來源:互聯網
上載者:User

three.js 源碼注釋(二十九)Cameras/OrthographicCamera.js,orthographiccamera

商域無疆 (http://blog.csdn.net/omni360/)

本文遵循“署名-非商業用途-保持一致”創作公用協議

轉載請保留此句:商域無疆 -  本部落格專註於 敏捷開發及移動和物聯裝置研究:資料視覺效果、GOLANG、Html5、WEBGL、THREE.JS,否則,出自本部落格的文章拒絕轉載或再轉載,謝謝合作。


俺也是剛開始學,好多地兒肯定不對還請見諒.

以下代碼是THREE.JS 源碼檔案中Cameras/OrthographicCamera.js檔案的注釋.

更多更新在 : https://github.com/omni360/three.js.sourcecode


/** * @author alteredq / http://alteredqualia.com/ *//*///OrthographicCamera方法根據  left, right, top, bottom, near, far 產生正交投影相機.OrthographicCamera對象的功能函數採用/// 定義構造的函數原型對象來實現.*////<summary>OrthographicCamera</summary>///<param name ="left" type="Number">指明相對於垂直平面的左側座標位置</param>///<param name ="right" type="Number">指明相對於垂直平面的右側座標位置</param>///<param name ="top" type="Number">指明相對於垂直平面的頂部座標位置</param>///<param name ="bottom" type="Number">指明相對於垂直平面的底部座標位置</param>///<param name ="near" type="Number">指明相對於深度剪下面的近的距離,必須為正數,選擇性參數,如果未指定,初始化為0.1</param>///<param name ="far" type="Number">指明相對於深度剪下面的遠的距離,必須為正數,選擇性參數,如果未指定,初始化為2000</param>///<returns type="OrthographicCamera">返回OrthographicCamera,正交投影相機.</returns>THREE.OrthographicCamera = function ( left, right, top, bottom, near, far ) {THREE.Camera.call( this );//調用Camera對象的call方法,將原本屬於Camera的方法交給當前對象OrthographicCamera來使用.this.left = left;//指明相對於垂直平面的相機的左側座標位置this.right = right;//指明相對於垂直平面的相機的右側座標位置this.top = top;//指明相對於垂直平面的相機的頂部座標位置this.bottom = bottom;//指明相對於垂直平面的相機的底部座標位置this.near = ( near !== undefined ) ? near : 0.1;//指明相對於深度剪下面的近的距離,必須為正數,選擇性參數,如果未指定,初始化為0.1this.far = ( far !== undefined ) ? far : 2000;//指明相對於深度剪下面的近的距離,必須為正數,選擇性參數,如果未指定,初始化為2000this.updateProjectionMatrix();//調用updateProjectionMatrix方法,更新相機的投影矩陣.};/******************************************************************************************下面是OrthographicCamera對象提供的功能函數定義,一部分通過prototype繼承自Camera方法***************************************************************************************/THREE.OrthographicCamera.prototype = Object.create( THREE.Camera.prototype );/*///updateProjectionMatrix方法返回正交投影相機的可視邊界的矩陣.*////<summary>updateProjectionMatrix</summary>///<returns type="OrthographicCamera">返回新的OrthographicCamera對象</returns>THREE.OrthographicCamera.prototype.updateProjectionMatrix = function () {this.projectionMatrix.makeOrthographic( this.left, this.right, this.top, this.bottom, this.near, this.far );//調用THREE.Matrix4.makeOrthographic產生正交矩陣};/*clone方法///clone方法複製OrthographicCamera對象*////<summary>clone</summary>///<returns type="OrthographicCamera">返回複製的OrthographicCamera對象</returns>THREE.OrthographicCamera.prototype.clone = function () {var camera = new THREE.OrthographicCamera();THREE.Camera.prototype.clone.call( this, camera );//調用THREE.Camera.Clone(camera)方法,複製相機對象camera.left = this.left;//將正交投影相機的 left 屬性值複製camera.right = this.right;//將正交投影相機的 right 屬性值複製camera.top = this.top;//將正交投影相機的 top 屬性值複製camera.bottom = this.bottom;//將正交投影相機的 bottom 屬性值複製camera.near = this.near;//將正交投影相機的 near 屬性值複製camera.far = this.far;//將正交投影相機的 far 屬性值複製return camera;//返回複製的OrthographicCamera對象};


商域無疆 (http://blog.csdn.net/omni360/)

本文遵循“署名-非商業用途-保持一致”創作公用協議

轉載請保留此句:商域無疆 -  本部落格專註於 敏捷開發及移動和物聯裝置研究:資料視覺效果、GOLANG、Html5、WEBGL、THREE.JS,否則,出自本部落格的文章拒絕轉載或再轉載,謝謝合作。


以下代碼是THREE.JS 源碼檔案中Cameras/OrthographicCamera.js檔案的注釋.

更多更新在 : https://github.com/omni360/three.js.sourcecode

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.