码迷,mamicode.com
首页 > Web开发 > 详细

three.js 源码注释(八十一)extras/geometries/TetrahedronGeometry.js

时间:2015-02-01 12:12:05      阅读:258      评论:0      收藏:0      [点我收藏+]

标签:webgl   数据可视化   three.js   web3d   三维   

商域无疆 (http://blog.csdn.net/omni360/)

本文遵循“署名-非商业用途-保持一致”创作公用协议

转载请保留此句:商域无疆 -  本博客专注于 敏捷开发及移动和物联设备研究:数据可视化、GOLANG、Html5、WEBGL、THREE.JS否则,出自本博客的文章拒绝转载或再转载,谢谢合作。


俺也是刚开始学,好多地儿肯定不对还请见谅.

以下代码是THREE.JS 源码文件中extras/geometries/TetrahedronGeometry.js文件的注释.

更多更新在 : https://github.com/omni360/three.js.sourcecode


/**
 * @author timothypratley / https://github.com/timothypratley
 */
/*
///TetrahedronGeometry用来在三维空间内创建一个四面体对象.
///
///	用法: var geometry = new THREE.TetrahedronGeometry(70);	
/// 	  var material = new THREE.MeshBasicMaterial({color: 0x00ff00});
/// 	  var icos = new THREE.Mesh(geometry,material);
/// 	  scene.add(icos);
*/
///<summary>TetrahedronGeometry</summary>
///<param name ="radius" type="float">四面体半径</param>
///<param name ="detail" type="int">细节因子,默认为0,当超过0将会有更多的顶点,当前的几何体就不会是四面体,当参数detail大于1,将会变成一个球体.</param>
THREE.TetrahedronGeometry = function ( radius, detail ) {
	//TODO: 四面体的参数呢????
	var vertices = [
		 1,  1,  1,   - 1, - 1,  1,   - 1,  1, - 1,    1, - 1, - 1
	];	//顶点数组

	var indices = [
		 2,  1,  0,    0,  3,  2,    1,  3,  0,    2,  3,  1
	];	//顶点索引

	THREE.PolyhedronGeometry.call( this, vertices, indices, radius, detail );

};
/*************************************************
****下面是TetrahedronGeometry对象的方法属性定义,继承自Geometry对象.
**************************************************/
THREE.TetrahedronGeometry.prototype = Object.create( THREE.Geometry.prototype );


商域无疆 (http://blog.csdn.net/omni360/)

本文遵循“署名-非商业用途-保持一致”创作公用协议

转载请保留此句:商域无疆 -  本博客专注于 敏捷开发及移动和物联设备研究:数据可视化、GOLANG、Html5、WEBGL、THREE.JS否则,出自本博客的文章拒绝转载或再转载,谢谢合作。


以下代码是THREE.JS 源码文件中extras/geometries/TetrahedronGeometry.js文件的注释.

更多更新在 : https://github.com/omni360/three.js.sourcecode

three.js 源码注释(八十一)extras/geometries/TetrahedronGeometry.js

标签:webgl   数据可视化   three.js   web3d   三维   

原文地址:http://blog.csdn.net/omni360/article/details/43370075

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!