We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello and thank you for this library,
I am trying to convert a STL file into a GLTF file.
So I create a mesh like this :
var mesh = new MeshBuilder<VertexPosition>(); var prim = mesh.UsePrimitive(material, 3); foreach (var stlMesh in reader.ReadFile()) { var vertice1 = VERTEX.Create(new System.Numerics.Vector3(stlMesh.vert1.x, stlMesh.vert1.y, stlMesh.vert1.z)); var vertice2 = VERTEX.Create(new System.Numerics.Vector3(stlMesh.vert2.x, stlMesh.vert2.y, stlMesh.vert2.z)); var vertice3 = VERTEX.Create(new System.Numerics.Vector3(stlMesh.vert3.x, stlMesh.vert3.y, stlMesh.vert3.z)); prim.AddTriangle(vertice1, vertice2, vertice3); }
So far so good, the conversion is ok and I am able to see the 3D object in a gltf viewer (https://gltf-viewer.donmccurdy.com/).
But now I would like to add normals to the mesh and I am stuck here. Is there any way to do it?
The text was updated successfully, but these errors were encountered:
Yes, you can use VertexPositionNormal instead of VertexPosition
If you check the Geometry/VertexTypes namespace, you'll see there's many vertex combinations already defined.
Furthermore, if at some point you need vertex colors or texture coodinates, you define them like this:
new MeshBuilder<VertexPositionNormal, VertexColor1Texture1>();
Sorry, something went wrong.
Yes, I saw that, but I came to understand it just now! Thanks for the quick answer.
No branches or pull requests
Hello and thank you for this library,
I am trying to convert a STL file into a GLTF file.
So I create a mesh like this :
So far so good, the conversion is ok and I am able to see the 3D object in a gltf viewer (https://gltf-viewer.donmccurdy.com/).
But now I would like to add normals to the mesh and I am stuck here.
Is there any way to do it?
The text was updated successfully, but these errors were encountered: