09-01-2021, 04:31 PM
Multiplying x by -1 inverts the orientation of the triangles.
This would require to invert the orientation of triangles - this could be done by swapping two triangle indices, for example if TriangleIndices are: 0 1 2 2 3 4 (two triangles with positions: first: 0 1 2, second: 2 3 4); to invert triangle orientation just swap two inices: 1 0 2 3 2 4 (first triangle 1 0 2; second: 3 2 4).
An easier option is to assign your material to BackMaterial instead of Material - BackMaterial is used to render back-facing triangles (a standard way to "debug" meshes is to set Material to green DiffuseMaterial and BackMaterial to red DiffuseMaterial - this shows which triangles need to be inverted).
This would require to invert the orientation of triangles - this could be done by swapping two triangle indices, for example if TriangleIndices are: 0 1 2 2 3 4 (two triangles with positions: first: 0 1 2, second: 2 3 4); to invert triangle orientation just swap two inices: 1 0 2 3 2 4 (first triangle 1 0 2; second: 3 2 4).
An easier option is to assign your material to BackMaterial instead of Material - BackMaterial is used to render back-facing triangles (a standard way to "debug" meshes is to set Material to green DiffuseMaterial and BackMaterial to red DiffuseMaterial - this shows which triangles need to be inverted).
Andrej Benedik

