Three.js Source Note (31) Scenes/fog.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 scenes/fog.js file in the three.js source file.

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


/** * @author mrdoob/http://mrdoob.com/* @author The constructor of the alteredq/http://alteredqualia.com/*//*///fog object. Used to create a linear fog effect within a scene, a line The fog effect is from the fog effect from the starting point parameter near, to the end of the parameter far, the intensity of the fog effect linearly increment, the function of the fog object is implemented by the function prototype object defined by///.//////usage: var fog = new three. Fog (three.colorkeywords.cyan,2,500)///From the beginning of the camera to a length of 2, 500 end of the area in the scene to add fog effect, fog effect color is cyan,*////<summary>fog</ Summary>///<param name = "Color" type= "three. Color "> Fog effect, if the fog effect color is set to black, objects in the distance will be rendered black </param>///<param name =" near "type=" number "> The starting point of applying fog effect, The near property of the fog effect is greater than the current camera's near property, the current camera is not affected by the camera, optional parameters, default is 1</param>///<param name = "Far" type= "number" > Apply fog effect end point, The far property of the fog effect is less than the current camera's far property, the current camera is not affected by the camera, optional parameters, default is 1000</param>///<returns type= "Fog" > Returns a new fog-effect object </returns >three. Fog = function (color, near, far) {this.name = ';//fog-Effect object property name, optional This.color = new three. The color attribute this.near = (near!== undefined)?//Fog Effect near:1;//application fog effect starting point, fog effect of the near property is greater than the current camera's near property, the current camera is not affected by the camera, optional parameters, the default is 1this.far = (far!== undefined)? far:1000;//the end point of the fog effect, the far property of the fog effect is less than the current phaseThe far property of the machine, the current camera will not be affected by the camera, optional parameters, default is 1000};/******************************************** the following are the function functions provided by the Fog object. ************** *clone method The///clone method clones a fog-effect object. *////<summary>clone</summary>///<returns Type= "Fog" > returns the cloned linear fog-effect object. </returns>three. Fog.prototype.clone = function () {return new three. Fog (This.color.getHex (), this.near, This.far);//returns the cloned linear fog-effect 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 scenes/fog.js file in the three.js source file.

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

Three.js Source Note (31) Scenes/fog.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.