Three. js source code annotation (80) extras/geometries/OctahedronGeometry. js, three. jsgeometries
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 extras/geometries/OctahedronGeometry. JS file in the THREE. js source code file.
More updates in: https://github.com/omni360/three.js.sourcecode
/*** @ Author timothypratley/https://github.com/timothypratley * // OctahedronGeometry is used to create an ry object in a 3D space. //// usage: var geometry = new THREE. octahedronGeometry (70); // var material = new THREE. meshBasicMaterial ({color: 0x00ff00}); // var icos = new THREE. mesh (geometry, material); // scene. add (icos ); * //// <summary> OctahedronGeometry </summary> // <param name = "radius" type = "float"> Al radius </param> /// <param name = "detail" type = "int"> detail factor, the default value is 0. When the value is greater than 0, more vertices will be generated, and the current ry will not be a ry. When the detail parameter is greater than 1, it will become a sphere. </param> THREE. octahedronGeometry = function (radius, detail) {this. parameters = {radius: radius, // detadetadetadetail: detail // detail factor. The default value is 0. When the value exceeds 0, more vertices are generated, the current ry will not be an ry. When the detail parameter is greater than 1, it will become a sphere .}; var vertices = [1, 0, 0,-1, 0, 0, 0, 1, 0,-1, 0, 0, 0, 0, 1, 0, 0, -1]; // vertex array var indices = [0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2]; // vertex index THREE. polyhedronGeometry. call (this, vertices, indices, radius, detail );}; /*************************************** * ************ the method attribute definition of the IcosahedronGeometry object is as follows, it inherits from the Geometry object. **************************************** * *********/THREE. octahedronGeometry. prototype = Object. create (THREE. geometry. prototype );
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 extras/geometries/OctahedronGeometry. JS file in the THREE. js source code file.
More updates in: https://github.com/omni360/three.js.sourcecode