Closed jlemus88 closed 2 months ago
These calculated normal methods you see in the library are internal and not intended to be used to create meshes, but to be used as fallback when loading a glTF with missing normals.
if you're creating a model, the library expects you to feed the normals you have calculated on your own or you have imported from somewhere else.
Keep in mind there's many ways of calculating the normals, depending on what you want to do. For example, if you would be able to use the "CalculateSmoothNormals" method on a "Cone" mesh, the base of the cone would be smoothed with the cone section, and it would look terrible. So you need to implement your own normals generation (you can copy the implemetnation of CalculateSmoothNormals) but you will also need some way to control normals splitting, like smooth groups or max smooth angle.
Hi, Im new to SharpGltf, I have a list of triangles without normals information, im generating a proper gltf model but i need to generate the normals before exporting the gltf.
I have been checking up the unit test and samples bit havent found wath i need.
hope you can help me.
I found:
public static IReadOnlyDictionary<Vector3, Vector3> CalculateSmoothNormals(this IMeshBuilder srcMesh)
but not sure how to use it.
`
using VERTEX = SharpGLTF.Geometry.VertexTypes.VertexPosition;
this is a fragment of the code i'm using
thanks in advance for any help