如果您在您发布的three.js url 中搜索源代码CircleGeometry
,您将看到该CircleGeometry
文件中包含该源代码。
THREE.CircleGeometry = function ( radius, segments, thetaStart, thetaLength ) {
THREE.Geometry.call( this );
radius = radius || 50;
thetaStart = thetaStart !== undefined ? thetaStart : 0;
thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2;
segments = segments !== undefined ? Math.max( 3, segments ) : 8;
// snipped...
}
所以你根本不需要包含任何额外的脚本。只需实例化你的圈子。
var circleGeom = new THREE.CircleGeometry(10);
three.js 中的“附加”都包含在分布式库中。库的源代码被分成许多文件,以保持代码库的组织性。但不要将其与将所有这些文件合并为一个以使其易于包含在网页中的内置库脚本混淆。