How to flip normal in BufferGeometry? current normal is from inside to outside, I want to flip that.
var geometry = new THREE.BufferGeometry();
var vertices = new Float32Array([
0, 0, 0,
80, 0, 0,
80, 80, 0,
0, 80, 0,
]);
var attribue = new THREE.BufferAttribute(vertices, 3);
geometry.attributes.position = attribue
var normals = new Float32Array([
0, 0, 1,
0, 0, 1,
0, 0, 1,
0, 0, 1,
]);
geometry.attributes.normal = new THREE.BufferAttribute(normals, 3);
var indexes = new Uint16Array([
0, 1, 2, 0, 2, 3,
])
geometry.index = new THREE.BufferAttribute(indexes, 1);
var uvs = new Float32Array([
0,0,
1,0,
1,1,
0,1,
]);
geometry.attributes.uv = new THREE.BufferAttribute(uvs, 2);