D
D
DstivjTS2018-10-31 16:50:57
Game development
DstivjTS, 2018-10-31 16:50:57

How are all the normals turned "out"?

A cube is generated randomly through a script, where each polygon of the cube is a separate mesh. The problem is that some polygons are turned "face" inside the cube, which makes them invisible. Is it possible to rotate all polygons to face "out" relative to the center of the cube?
Tried to reverse triangular - the problem is - it is not known which polygons need to be rotated - it turns out the other way around.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Gaydak, 2018-11-01
@DstivjTS

In the video proposed by Konstantin Kitmanov , at 3:55 they talk about the "counterclockwise" rule.
as a result
, in the version of the mesh generated from the script, it is most correct not to rotate the faces / meshes of the cube (although this is also possible, but not worth it), but correctly specify the order of vertices in triangles / polygons so that the "front" side is correctly directed by default)

B
Breathing, 2018-11-01
@Breathing

It might be better to use primitives
GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
and already cut it into meshes. then 100% normals will be fine.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question