- reverseNormals ()
The reverseNormals operation reverses the face normals of the geometry of the current shape.
Left box: face with index=0 not inverted
Right box: face with index=0 inverted
Advanced knowledge: Understanding the reversion process
Normals: The normal of a polygonal face is defined by the vertex order. By default, the order is counterclockwise.
Some advanced users may notice that after the reverseNormals command, the vertex order [black] is not only inverted (as in the classic mathematical definition of the normal inversion [blue]) but is offset by the value of 1 [red]. The reason for this is because the CityEngine often works with the "First Edge", which is defined by the vertex indices 0 and 1. Thus, in the reverseNormals command, the "First Edge" is retained.
- black: standard vertex order of the face (counterclockwise)
- blue: classic reverted vertex order
- red: reverted vertex order as used in the CityEngine, with retained first edge.