# Flip Normals Three.JS after flipped geometry

I followed this stackoverflow example: Geometry 3DJS

I have successfully flipped my geometry. However, now my geometry is black. Can I flip my normals at the same time as the geometry to fix this? Or should I use a different approach to mirror the geometry from the start?

### EDIT:

Tried adding updates to this code and still have geometry inverted.

``````#transformation
mS.elements[5] = -1;
mesh.applyMatrix(mS);

mesh.geometry.verticesNeedUpdate = true;
mesh.geometry.normalsNeedUpdate = true;
mesh.geometry.computeBoundingSphere();
mesh.geometry.computeFaceNormals();
mesh.geometry.computeVertexNormals();
```

```

+3

source to share

``````mesh.geometry.verticesNeedUpdate = true;
mesh.geometry.normalsNeedUpdate = true;
mesh.geometry.computeBoundingSphere();
mesh.geometry.computeFaceNormals();
mesh.geometry.computeVertexNormals();
```

```

+2

source

This is an old question, but for those who are still lost: a normal face is calculated by looking at the opposite clockwise vertex order.

So, if you need to flip the normals, you need to reorder the vertices assigned to the face. For example:

``````var tmp;
for(var f = 0; f < geometry.faces.length; f++) {
tmp = geometry.faces[f].clone();
geometry.faces[f].a = tmp.c;
geometry.faces[f].c = tmp.a;
}
```

```
+1

source

You may try:

``````mesh.geometry.reverse(computeFaceNormals());
mesh.geometry.reverse(computeVertexNormals());
```

```
-2

source

All Articles