problems with three normals on vertex
problems with three normals on vertex
When I load 3ds model to irrlicht each vertex has three normals instead of one, so lighting is not smooth on these models but broken on edges so triangles are visible. Anyone knows irrlicht API that would calculate only one normal on vertex?
Re: problems with three normals on vertex
Irrlicht has only one normal per vertex. But maybe you have more than one vertex on the same point for some reason?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: problems with three normals on vertex
Yes, the 3ds loader duplicates vertices. You can use the mesh manipulator to weld the vertices together, and recalculate normals then. Better idea might be to use a different mesh format, though, as 3ds is not really well supported.
Re: problems with three normals on vertex
But the question in 3d forum is oriented toward Blender exporting, there I ask 3D experts. Question here is for irrlicht API, but OK.
X format has same problem.
X format has same problem.
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: problems with three normals on vertex
Well, it does not matter where the model is exported from. It's just an issue with 3ds files in Irrlicht.
Re: problems with three normals on vertex
Maybe duplicated vertices.
Use blender/3dmax or irr mesh manipulator to clean them up first.
Regards
smso
Use blender/3dmax or irr mesh manipulator to clean them up first.
Regards
smso
Re: problems with three normals on vertex
According to this thread: http://irrlicht.sourceforge.net/forum/v ... =4&t=30793
Welding vertices won't do anything. In fact, I don't care if there are three vertices, just as long as their 3 normals are all in one direction.
How do I go about finding vertices with same position and then changing their normals to new average value?
Welding vertices won't do anything. In fact, I don't care if there are three vertices, just as long as their 3 normals are all in one direction.
How do I go about finding vertices with same position and then changing their normals to new average value?
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: problems with three normals on vertex
Iterate over all vertices and check if they coincide. Next you need to find all faces, and calculcate the normals over all adjacency faces, get the average, and assign to all those normals you found in the first place.
Re: problems with three normals on vertex
do you have access over the original model and how its exported ? the three normals on the vert are there because there are 3 faces with different smoothing groups using this vert. Smoothing groups are used in 3ds Max as a way of putting hard edges on meshes. This is entirely desirable on say the corner of a cube, and as mentioned above it would actually be exported as 3 verts in the same position each with its own normal. As opposed to something like a sphere where it would not be so useful other than for some deliberate visual reason. If the later case and if you can edit it the model so that the faces all have the same smoothing group and re-export all will be dandy. Its worth noting that a break in Smoothing, UVs, vertex colours, vertex alpha etc should cause a duplicate vertex to be produced to achieve the same visual effects of a 3ds max model in a game engine.
Re: problems with three normals on vertex
After trying to use the 3ds format some time ago i just concluded to not use it anymore, It sucks!
I dont think it support sharing of vertices/smoothing groups, witch basically made it slower in realtime than other better formats.
My advice is import it into blender and convert to ply, or obj.
k
I dont think it support sharing of vertices/smoothing groups, witch basically made it slower in realtime than other better formats.
My advice is import it into blender and convert to ply, or obj.
k