Three. js source code annotation () Material/MeshFaceMaterial. js, three. js
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 materials/MeshFaceMaterial. JS file in the THREE. js source code file.
More updates in: https://github.com/omni360/three.js.sourcecode
/*** @ Author mrdoob/http://mrdoob.com/* // The MeshFaceMaterial method creates a composite material type for mesh (mesh) based on the parameter materials, the material parameter is an array object of the Material type. The triangle attribute materialindex in the mesh defines the index number of the material object used by the triangle. * //// <summary> MeshFaceMaterial </summary> /// <param name = "materials" type = "Array"> Array of the Material type </param> /// <returns type = "MeshFaceMaterial"> returns MeshFaceMaterial, composite Material. </returns> THREE. meshFaceMaterial = function (materials) {t His. materials = materials instanceof Array? Materials: []; // determines whether the type of the material parameter is an array object .}; /*************************************** * ************************ the method property definition of the MeshFaceMaterial object is as follows ****** **************************************** * **************/* clone method // clone method to clone the MeshFaceMaterial object, * //// <summary> clone </summary> /// <returns type = "MeshFaceMaterial"> returns the cloned MeshFaceMaterial object </returns> THREE. meshFaceMaterial. prototype. clone = function () {var material = new THREE. meshFaceMaterial (); for (var I = 0; I <this. materials. length; I ++) {material. materials. push (this. materials [I]. clone ();} return material; // return the cloned MeshFaceMaterial 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 materials/MeshFaceMaterial. JS file in the THREE. js source code file.
More updates in: https://github.com/omni360/three.js.sourcecode