Three. js source code annotation (19th) Cameras/OrthographicCamera. js, orthographiccamera
Wuji (http://blog.csdn.net/omni360)
This article follows the "signature-non-commercial use-consistency" creation public agreement
Reprinted please keep this sentence: Wuji-this blog focuses on Agile development and mobile and IOT device research: data visualization, GOLANG, Html5, WEBGL, THREE. JS. Otherwise, the post from this blog will not be reprinted or reprinted. Thank you for your cooperation.
I also just started learning. Sorry for the errors in many places.
The following code is a comment on the Cameras/OrthographicCamera. JS file in the THREE. js source code file.
More updates in: https://github.com/omni360/three.js.sourcecode
/*** @ Author alteredq/http://alteredqualia.com/* // OrthographicCamera method generates orthogonal projection cameras based on left, right, top, bottom, near, and far. the function functions of the OrthographicCamera object are implemented using a function prototype object constructed. * //// <summary> OrthographicCamera </summary> // <param name = "left" type = "Number"> specifies the Coordinate Position on the left of the plane relative to the vertical plane </param> /// <param name = "right" type = "Number"> specify the right coordinate position relative to the vertical plane </param> /// <param name = "top" type = "Number"> specifies the coordinate position at the top of the vertical plane </param> /// <Param name = "bottom" type = "Number"> specifies the coordinate position at the bottom of the vertical plane </param> // <param name = "near" type = "Number"> specify the distance relative to the deep cut surface, must be a positive number. optional parameter. If not specified, initialize to 0.1 </param> /// <param name = "far" type = "Number"> indicates the distance from the depth cut surface. It must be a positive Number. An optional parameter, if not specified, the initialization is 2000 </param> // <returns type = "OrthographicCamera"> returns OrthographicCamera, an orthogonal projection camera. </returns> THREE. orthographicCamera = function (left, right, top, bottom, near, far) {THREE. camera. call (This); // call the call method of the Camera object and hand over the method originally belonging to the Camera to the current object OrthographicCamera for use. this. left = left; // specify the left Coordinate Position of the camera relative to the vertical plane. this. right = right; // specifies the right Coordinate Position of the camera relative to the vertical plane. this. top = top; // specifies the coordinate position at the top of the camera relative to the vertical plane. this. bottom = bottom; // specifies the coordinate position at the bottom of the camera relative to the vertical plane. this. near = (near! = Undefined )? Near: 0.1; // specify the distance relative to the deep cut surface. It must be a positive number. An optional parameter. If not specified, it is initialized to 0.1this.far = (far! = Undefined )? Far: 2000; // specify the distance relative to the depth cut surface. It must be a positive number. An optional parameter. If not specified, the value is 2000this. updateProjectionMatrix (); // call the updateProjectionMatrix method to update the projection matrix of the camera .}; /*************************************** **************************************** * ********* the function definitions provided by the OrthographicCamera object are as follows, some of them inherit from the Camera method through prototype ********************************* **************************************** * *************/THREE. orthographicCamera. prototype = Object. create (THREE. camera. prototype); // * // The updateProjectionMatrix method returns the matrix of the visible 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 generation orthogonal matrix }; /* clone method // clone method to clone the 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 to Clone the camera object camera. left = this. left; // copy the left attribute value of the orthogonal projection camera to the camera. right = this. right; // copy the right attribute value of the orthogonal projection camera to camera. top = this. top; // copy the top property value of the orthogonal projection camera to camera. bottom = this. bottom; // copy the bottom attribute value of the orthogonal projection camera to camera. near = this. near; // copy the near attribute value of the orthogonal projection camera to camera. far = this. far; // copy the far attribute value of the orthogonal projection camera to return camera; // return the cloned OrthographicCamera object };
Wuji (http://blog.csdn.net/omni360)
This article follows the "signature-non-commercial use-consistency" creation public agreement
Reprinted please keep this sentence: Wuji-this blog focuses on Agile development and mobile and IOT device research: data visualization, GOLANG, Html5, WEBGL, THREE. JS. Otherwise, the post from this blog will not be reprinted or reprinted. Thank you for your cooperation.
The following code is a comment on the Cameras/OrthographicCamera. JS file in the THREE. js source code file.
More updates in: https://github.com/omni360/three.js.sourcecode