ParametricGeometry 参数几何体

—> Geometry

ParametricGeometry 的第一个参数是一个函数 Function, 而这个函数必须包含3个参数. 函数内申明 x, y, z 变量.

function ParametricGeometry( func, slices, stacks ) { } var ArchimedeanSpiral = function(u, v, target){ var r = 5 * u; var x = -r * Math.sin(u * 10 * Math.PI); var y = r * Math.cos(u * 10 * Math.PI); var z = 2 * v; return target.set( x, y, z ); }; var geometry = new THREE.ParametricGeometry(ArchimedeanSpiral, 220, 120); material = new THREE.MeshBasicMaterial({color: 0x663399, side: THREE.DoubleSide}), cube = new THREE.Mesh( geometry, material ); scene.add( cube );

Parameters

func slices stacks
Function Int Int
函数 薄皮

Methods 继承自 Geometry 并自动调用

fromBufferGeometry( new ParametricBufferGeometry( func, slices, stacks ) )
mergeVertices( )

ParametricBufferGeometry

function ParametricBufferGeometry( func, slices, stacks ) { }

Methods 继承自 BufferGeometry 并自动调用

setIndex( )
addAttribute( )

图解API

纹理Texture来渲染参数几何体模型. 点开查看