BoxGeometry 长方体

—> Geometry

Box 是盒子的意思, BoxGeometry 可用来创建各种盒式的长方体模型, 当 width, height, depth 三者相等时, 就会得到正方体模型了.

function BoxGeometry( width, height, depth, widthSegments, heightSegments, depthSegments ) { } var geometry = new THREE.BoxGeometry(1, 1, 1), material = new THREE.MeshBasicMaterial({color: 0x663399, side: THREE.DoubleSide}), cube = new THREE.Mesh( geometry, material ); scene.add( cube );

Parameters

width height depth widthSegments heightSegments depthSegments
1 1 1
宽度 高度 深度 宽度分段数 高度分段数 深度分段数

Methods 继承自 Geometry 并自动调用

fromBufferGeometry( new BoxBufferGeometry( width, height, depth, widthSegments, heightSegments, depthSegments ) )
mergeVertices( )

BoxBufferGeometry

function BoxBufferGeometry( width, height, depth, widthSegments, heightSegments, depthSegments ) { } var geometry = new THREE.BoxBufferGeometry(1, 1, 1), material = new THREE.MeshBasicMaterial({color: 0x663399, side: THREE.DoubleSide}), cube = new THREE.Mesh( geometry, material ); scene.add( cube );

图解API

纹理Texture来渲染长方体模型. 点开查看