Hi everyone I am making my first game in 3d.
Now I have my world rendering fine but now want to added lighting.
However to do that I need to calculate the normal of each vertex. Can somone point me in the right direction on how to do this as I don’t really know what I’m looking for.
if you have A,B,C triangle you get the edges ab & cb var ab = A - B; var cb = C - B;
normalize, ab.Normalize(); cb.Normalize();
and then get a vector perpendicular to those two edges return Vector3.Cross(ab, cb);