Three. js source code comments (forty-one) Light/AmbientLight. js
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 Light/AmbientLight. JS file in the THREE. js source code file.
/*** @ Author mrdoob/http://mrdoob.com/* // The AmbientLight method creates ambient light based on the color attribute of the light. the functions of the AmbientLight object are implemented using a function prototype object constructed by // definition. /// TODO: the shadow of the AmbientLight type has not been implemented in this version .??? /// Example: // var light = new THREE. AmbientLight (0x404040); // scene. add (light );*////AmbientLight///Color Attribute of ambient light ///
The return value is PointLight.
THREE. ambientLight = function (color) {THREE. light. call (this, color); // call the call method of the Light object, and hand over the method originally belongs to the Light to the current object AmbientLight for use .}; /*************************************** **************************************** * ********** The following is a function definition provided by the AmbientLight object, some of them inherit from the Light method through prototype ********************************* **************************************** * *************/THREE. ambientLight. prototype = Object. create (THREE. light. prototype); // AmbientLight object from THREE. the Light prototype inherits all the property methods/* clone method // clone method to clone the AmbientLight object *////Clone///
Returns the cloned AmbientLight object.
THREE. ambientLight. prototype. clone = function () {var light = new THREE. ambientLight (); THREE. light. prototype. clone. call (this, light); // call THREE. light method, clone the light object return Light; // return the cloned environment light object };Http://www.bkjia.com/kf/201412/359021.html previous