three.js ParametricGeometry

2023-02-16 17:49 更新

生成由參數(shù)表示其表面的幾何體。

代碼示例

const geometry = new THREE.ParametricGeometry( THREE.ParametricGeometries.klein, 25, 25 );
const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
const klein = new THREE.Mesh( geometry, material );
scene.add( klein );

構(gòu)造函數(shù)

ParametricGeometry(func : Function, slices : Integer, stacks : Integer)

func — 一個(gè)函數(shù),它接受一個(gè)介于 0 和 1 之間的 u 和 v 值,并修改第三個(gè) Vector3 參數(shù)。默認(rèn)是生成曲面的函數(shù)。

slices — 用于參數(shù)函數(shù)的切片數(shù)。默認(rèn)值為 8。

stacks — 用于參數(shù)函數(shù)的堆棧數(shù)。默認(rèn)值為 8。

屬性

共有屬性請(qǐng)參見(jiàn)其基類(lèi)BufferGeometry。

.parameters : Object

一個(gè)包含著構(gòu)造函數(shù)中每個(gè)參數(shù)的對(duì)象。在對(duì)象實(shí)例化之后,對(duì)該屬性的任何修改都不會(huì)改變這個(gè)幾何體。

方法(Methods)

共有方法請(qǐng)參見(jiàn)其基類(lèi)BufferGeometry。

方法

examples/jsm/geometries/ParametricGeometry.js


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)