refactor: update geometry creation to include additional parameters for BoxGeometry
This commit is contained in:
+8
-8
@@ -14,16 +14,16 @@ const scene = new THREE.Scene();
|
|||||||
/**
|
/**
|
||||||
* Object
|
* Object
|
||||||
*/
|
*/
|
||||||
// const geometry = new THREE.BoxGeometry(1, 1, 1);
|
const geometry = new THREE.BoxGeometry(1, 1, 1, 2, 2, 2);
|
||||||
|
|
||||||
const positionsArray = new Float32Array([
|
// const positionsArray = new Float32Array([
|
||||||
0, 0, 0,
|
// 0, 0, 0,
|
||||||
0, 1, 0,
|
// 0, 1, 0,
|
||||||
1, 0, 0
|
// 1, 0, 0
|
||||||
]);
|
// ]);
|
||||||
|
|
||||||
const geometry = new THREE.BufferGeometry();
|
// const geometry = new THREE.BufferGeometry();
|
||||||
geometry.setAttribute('position', new THREE.BufferAttribute(positionsArray, 3));
|
// geometry.setAttribute('position', new THREE.BufferAttribute(positionsArray, 3));
|
||||||
|
|
||||||
const material = new THREE.MeshBasicMaterial({ color: 0xff0000, wireframe: true });
|
const material = new THREE.MeshBasicMaterial({ color: 0xff0000, wireframe: true });
|
||||||
const mesh = new THREE.Mesh(geometry, material);
|
const mesh = new THREE.Mesh(geometry, material);
|
||||||
|
|||||||
Reference in New Issue
Block a user