Three.js Source Note (29) cameras/orthographiccamera.js

Source: Internet
Author: User

Commercial Territory (http://blog.csdn.net/omni360/)

This article follows "Attribution-non-commercial use-consistent" authoring public agreement

Reprint Please keep this sentence: Business Domain-this blog focuses on Agile development and mobile and IoT device research: Data visualization, Golang, HTML5, WEBGL, three. JS, Otherwise, from this blog article refused to reprint or reprint, thank you for your cooperation.


I was just beginning to learn, a lot of things are definitely wrong and please forgive me.

The following code is a comment for the cameras/orthographiccamera.js file in the three.js source file.

More updates in: Https://github.com/omni360/three.js.sourcecode


/** * @author alteredq/http://alteredqualia.com/*//*///orthographiccamera method generates orthogonal based on left, right, top, bottom, near and far Projection camera. The function functions of the Orthographiccamera object are implemented by using the function prototype object defined by///.*////<summary>orthographiccamera</summary>///< param name = "Left" type= "number" > indicates the coordinate position relative to the vertical plane </param>///<param name = "Right" type= "number" > Indicates the right coordinate position relative to the vertical plane </param>///<param name = "Top" type= "number" > indicates the top coordinate position relative to the vertical plane </param>///< param name = "bottom" type= "number" > indicates the bottom coordinate position relative to the vertical plane </param>///<param name = "near" type= "number" > Indicates that the close distance from the depth clipping face must be a positive number, an optional parameter, if unspecified, initialized to 0.1</param>///<param name = "Far" type= "number" > indicates the distance from the deep clipping plane, Must be a positive number, optional parameter, if unspecified, initialized to 2000</param>///<returns type= "Orthographiccamera" > Return orthographiccamera, orthographic projection camera. </returns>three. Orthographiccamera = function (left, right, top, bottom, near, far) {three. Camera.call (this);//The Call method of the camera object is called, the method that originally belongs to the camera is given to the current object Orthographiccamera to use. This.left = left;//indicates that the camera is relative to the vertical plane.Left coordinate position this.right = right;//indicates the right coordinate position of the camera relative to the vertical plane This.top = top;//indicates the top coordinate position of the camera relative to the vertical plane This.bottom = bottom;// Indicates the bottom coordinate position of the camera relative to the vertical plane this.near = (near!== undefined)? near:0.1;//indicates that the close distance from the depth clipping plane must be a positive number, an optional parameter, and, if unspecified, initialized to 0.1this.far = (far!== undefined)? far:2000;//indicates that the close distance from the depth clipping plane must be a positive number, an optional parameter, if unspecified, initialized to 2000this.updateprojectionmatrix ();//Call Updateprojectionmatrix method To update the camera's projection matrix.};/ The following is a functional function provided by the Orthographiccamera object Part of the prototype inherits from the camera method *********************************************************************************** /three. Orthographiccamera.prototype = Object.create (three. Camera.prototype); The/*///updateprojectionmatrix method returns the matrix of the visual boundary of the orthogonal projection camera .*////<summary>updateprojectionmatrix< /summary>///<returns type= "Orthographiccamera" > returns the new Orthographiccamera object </returns>three. OrthographicCamera.prototype.updateProjectionMatrix = function () {this.projectionMatrix.makeOrthographic ( This.left,This.right, This.top, This.bottom, This.near, This.far);//Call THREE.Matrix4.makeOrthographic to generate an orthogonal matrix};/*clone method/// Clone method Cloning Orthographiccamera object *////<summary>clone</summary>///<returns type= "OrthographicCamera" > returns the cloned Orthographiccamera object </returns>three. OrthographicCamera.prototype.clone = function () {var camera = new three. Orthographiccamera (); Three. Camera.prototype.clone.call (this, camera);//Call THREE.Camera.Clone (camera) method, clone camera Object camera.left = this.left;// Copy the Left property value of the orthographic projection camera camera.right = this.right;//Copy the right property value of the orthographic projection camera camera.top = this.top;//The top of the orthographic projection camera Property value Copy camera.bottom = this.bottom;//Copy the bottom property value of the orthographic projection camera camera.near = this.near;//Copies the near property value of the orthographic projection camera Camera.far = this.far;//Copy the Far property value of the orthographic projection camera to return camera;//returns the cloned Orthographiccamera object};


Commercial Territory (http://blog.csdn.net/omni360/)

This article follows "Attribution-non-commercial use-consistent" authoring public agreement

Reprint Please keep this sentence: Business Domain-this blog focuses on Agile development and mobile and IoT device research: Data visualization, Golang, HTML5, WEBGL, three. JS, Otherwise, from this blog article refused to reprint or reprint, thank you for your cooperation.


The following code is a comment for the cameras/orthographiccamera.js file in the three.js source file.

More updates in: Https://github.com/omni360/three.js.sourcecode

Three.js Source Note (29) cameras/orthographiccamera.js

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.