three.js Box3Helper

2023-02-16 17:41 更新

模擬3維包圍盒 Box3 的輔助對(duì)象.

代碼示例

const box = new THREE.Box3();
box.setFromCenterAndSize( new THREE.Vector3( 1, 1, 1 ), new THREE.Vector3( 2, 1, 3 ) );

const helper = new THREE.Box3Helper( box, 0xffff00 );
scene.add( helper );

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

Box3Helper( box : Box3, color : Color )

box -- 被模擬的3維包圍盒.
color -- (可選的) 線框盒子的顏色. 默認(rèn)為 0xffff00.

創(chuàng)建一個(gè)新的線框盒子用以表示指定的3維包圍盒.

屬性

請(qǐng)到基類 LineSegments 頁(yè)面查看公共屬性.

.box : Box3

被模擬的3維包圍盒.

方法

請(qǐng)到基類 LineSegments 頁(yè)面查看公共方法.

.updateMatrixWorld ( force : Boolean ) : undefined

重寫基類 Object3D 的該方法以便于 同時(shí)更新線框輔助對(duì)象與 .box 屬性保持一致.

源碼

src/helpers/Box3Helper.js


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

掃描二維碼

下載編程獅App

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

編程獅公眾號(hào)