I am seeking a way to reverse the order of vertices in faces within my geometry. For instance:
// create geometry
var geometry = new THREE.Geometry();
// create vertices
geometry.vertices.push( new THREE.Vector3( 0, 0, 0 ) );
geometry.vertices.push( new THREE.Vector3( 0, 100, 0 ) );
geometry.vertices.push( new THREE.Vector3( 100, 0, 0 ) );
// create face
var face = new THREE.Face3( 0, 1, 2 );
geometry.faces.push ( face );
// compute normals
geometry.computeFaceNormals();
geometry.computeVertexNormals();
// add to scene
var mesh = new THREE.Mesh(
geometry,
new THREE.MeshBasicMaterial({color: 0x00ffff})
);
scene.add( mesh );
Now I am looking for a way to dynamically change the order of vertices in a face from 0,1,2 to 2,1,0. Despite setting update flags to true, manual adjustments do not achieve the desired outcome.
The query - is it viable to manipulate vertices order seamlessly and if so, how?
Note: It’s recommended to steer clear of utilizing negative scale on geometry in this scenario. Additionally, object recreation should be avoided.
THREE.js: r73