W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
創(chuàng)建具有軸對(duì)稱性的網(wǎng)格,比如花瓶。車削繞著Y軸來(lái)進(jìn)行旋轉(zhuǎn)。
const points = [];
for ( let i = 0; i < 10; i ++ ) {
points.push( new THREE.Vector2( Math.sin( i * 0.2 ) * 10 + 5, ( i - 5 ) * 2 ) );
}
const geometry = new THREE.LatheGeometry( points );
const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
const lathe = new THREE.Mesh( geometry, material );
scene.add( lathe );
points — 一個(gè)Vector2對(duì)象數(shù)組。每個(gè)點(diǎn)的X坐標(biāo)必須大于0。 Default is an array with (0,-0.5), (0.5,0) and (0,0.5) which creates a simple diamond shape.
segments — 要生成的車削幾何體圓周分段的數(shù)量,默認(rèn)值是12。
phiStart — 以弧度表示的起始角度,默認(rèn)值為0。
phiLength — 車削部分的弧度(0-2PI)范圍,2PI將是一個(gè)完全閉合的、完整的車削幾何體,小于2PI是部分的車削。默認(rèn)值是2PI。
基于參數(shù)創(chuàng)建一個(gè)LatheGeometry。
共有屬性請(qǐng)參見(jiàn)其基類BufferGeometry。
一個(gè)包含著構(gòu)造函數(shù)中每個(gè)參數(shù)的對(duì)象。在對(duì)象實(shí)例化之后,對(duì)該屬性的任何修改都不會(huì)改變這個(gè)幾何體。
共有方法請(qǐng)參見(jiàn)其基類BufferGeometry。
src/geometries/LatheGeometry.js
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: