Three.js Source Note (49) material/meshnormalmaterial.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 material/meshnormalmaterial.js file in the three.js source file.

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

/** * @author mrdoob/http://mrdoob.com/* * parameters = {* Opacity: <float>, * * shading:three. Flatshading, * blending:three. normalblending, * depthtest: <bool>, * depthwrite: &LT;BOOL&GT;, * * wireframe: <boolean>, * wireframeline Width: <float> *} The *//*///meshnormalmaterial method creates the standard material type of mesh (mesh) According to the parameter parameters, so I really don't know how to translate it. It is better to call Normalmaterial,///parameters the format of the parameter to see above. The function function of the Meshnormalmaterial object is implemented by defining the function prototype object constructed. Most attribute methods inherit from the base class of the material material.*////<summary>meshnormalmaterial</ Summary>///<param name = "Parameters" type= "String" >string type JSON format material property parameter </param>///<returns type = "Meshnormalmaterial" > Return meshnormalmaterial, Mesh standard material. </returns>three. meshnormalmaterial = function (parameters) {three. Material.call (this, parameters);//Call method of the Material object is called, the method that originally belongs to Material is given to the current object meshnormalmaterial to use. this.shading = Three. flatshading;//coloring Way, three. Flatshading//gl_flat constant Coloring: for points, lines or polygons are drawn in one color, and the color of the entire entity is the color of any point.    There are several three.noshading = 0; NoColoring???? Three. smoothshading = 1; Smooth shading: Draws in a variety of colors, each of which is handled separately, with uniform interpolation between vertices and elements. This.wireframe = false;//Renders the geometry as wireframe. The default is Falsethis.wireframelinewidth = 1;//the width of the wireframe. This.morphtargets = false;// Defines whether the material sets the target warp animation, which defaults to falsethis.setvalues (parameters);//calls the Setvalues method of the material class, Assigns the parameter parameters to the properties of the current meshnormalmaterial material.};/ The following is the method property definition for the Meshnormalmaterial object, inherited from the material*** /three. Meshnormalmaterial.prototype = Object.create (three. Material.prototype);/*clone method///clone Method Clone Meshnormalmaterial Object,*////<summary>clone</summary>///< param name = "material" type= "meshnormalmaterial" >meshnormalmaterial object, optional. </param>///<returns type= " Meshnormalmaterial "> returns the cloned Meshnormalmaterial object </returns>three. MeshNormalMaterial.prototype.clone = function () {//The following is a copy of the properties of the material, var material = new three. Meshnormalmaterial (); Three. Material.prototype.clone.call (this, Material); material.shading = This.shading;material.wireframe = This.wireframe;material.wireframelinewidth = This.wireframelinewidth;return material;//Returns the cloned Meshnormalmaterial 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 material/meshnormalmaterial.js file in the three.js source file.

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

Three.js Source Note (49) material/meshnormalmaterial.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.