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 extras/geometries/icosahedrongeometry.js file in the three.js source file.
More updates in: Https://github.com/omni360/three.js.sourcecode
/** * @author Timothypratley/https://github.com/timothypratley *//*///icosahedrongeometry is used to create a 20-facet object within three-dimensional space.////// Usage: var geometry = new three. Icosahedrongeometry////var material = new three. Meshbasicmaterial ({color:0x00ff00});///var icos = new three. Mesh (geometry,material);////Scene.add (ICOS); *////<summary>icosahedrongeometry</summary>///<param Name = "radius" type= "float" > 20 face Body radius </param>///<param name = "detail" type= "int" > Detail factor, default is 0, when more than 0 will have more vertices , the current geometry will not be a 20-face body, and when the parameter detail is greater than 1, it will become a sphere. </param>three. Icosahedrongeometry = function (radius, detail) {this.parameters = {radius:radius,//20 face body radius detail:detail//detail factor, default is 0, when super Over 0 will have more vertices, the current geometry will not be 20 faces, when the parameter detail greater than 1, will become a sphere};var T = (1 + math.sqrt (5))/2;var vertices = [-1, T, 0, 1, t, 0,-1,-T, 0, 1,-T, 0, 0,-1, T, 0, 1, t, 0,-1,-T, 0, 1,-T, T, 0,-1, T, 0, 1,- T, 0,-1,-T, 0, 1]; Vertex array var indices = [0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1];//index. Three. Polyhedrongeometry.call (this, vertices, indices, radius, detail);//Call method that calls the Polyhedrongeometry object, The method that originally belonged to geometry is given to the current object icosahedrongeometry to use.};/ The following is a method property definition for the Icosahedrongeometry object, inherited from the Geometry object. *********** /three. Icosahedrongeometry.prototype = Object.create (three. Geometry.prototype);
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 extras/geometries/icosahedrongeometry.js file in the three.js source file.
More updates in: Https://github.com/omni360/three.js.sourcecode
Three.js Source Note (78) Extras/geometries/icosahedrongeometry.js