mbh1620 / Final-Year-Project

Repository For Final Year Project Mesh Simplification By Edge Collapsing Method
0 stars 0 forks source link

Function needed for calculating Face Normals #1

Open mbh1620 opened 1 year ago

mbh1620 commented 1 year ago

A function used to work out the normal of a triangle.

Multiple other sub functions will also be needed to complete this function:

Input: 3 3D vertices (in a Vector data type)

Output: A 3D Vector (in a Vector data type)

mbh1620 commented 1 year ago

Need to use a Vertex Class for the input https://github.com/mbh1620/Final-Year-Project/issues/5

mbh1620 commented 1 year ago

Testing on a cube obj showing that the normals calculated are the same as provided in the obj file!

obj file normals

Image

calculated normals

Image

Important to realise that in this function there will be two triangles for every quad in the obj file. This is why there is two values calculated for every single normal in the obj file.

Also important to remember that in the obj file, these are vertex normals not face normals.