refactor: update geometry creation to include additional parameters for BoxGeometry

This commit is contained in:
sayudhalw
2026-08-24 19:52:45 +07:00
parent df350c2096
commit 0df0119434
+8 -8
View File
@@ -14,16 +14,16 @@ const scene = new THREE.Scene();
/**
* Object
*/
// const geometry = new THREE.BoxGeometry(1, 1, 1);
const geometry = new THREE.BoxGeometry(1, 1, 1, 2, 2, 2);
const positionsArray = new Float32Array([
0, 0, 0,
0, 1, 0,
1, 0, 0
]);
// const positionsArray = new Float32Array([
// 0, 0, 0,
// 0, 1, 0,
// 1, 0, 0
// ]);
const geometry = new THREE.BufferGeometry();
geometry.setAttribute('position', new THREE.BufferAttribute(positionsArray, 3));
// const geometry = new THREE.BufferGeometry();
// geometry.setAttribute('position', new THREE.BufferAttribute(positionsArray, 3));
const material = new THREE.MeshBasicMaterial({ color: 0xff0000, wireframe: true });
const mesh = new THREE.Mesh(geometry, material);