Three. js source code annotation (80) extras/geometries/OctahedronGeometry. js, three. jsgeometries

Source: Internet
Author: User

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

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.