Hi, i have vertices that when is use line, it works, but when i change to mesh it doesn’t
var vertices = new Float32Array( [
0, 0, 0,
8, 0, 0,
8, -2, 0,
10, -2, 0,
10, -10, 0,
0, -10, 0,
0, 0, 0
]);
geometry.addAttribute( 'position', new THREE.BufferAttribute(vertices, 3));
var material = new THREE.MeshBasicMaterial({ color: 0xff0000 });
let line = new THREE.Line(geometry, material); // let line = new THREE.Mesh(geometry, material); doesnt work
I tried adding the vertices one after another, but i notice it wont when point has a negative number.
var vertices = new Float32Array( [
0, 0, 0,
8, 0, 0,
8, 5, 0, // if i change to (8, -5, 0) mesh wont show
]);
geometry.addAttribute( 'position', new THREE.BufferAttribute(vertices, 3));
var material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
let line = new THREE.Mesh(geometry, material);