I am experimenting with XNA and wrote a little X3D importer to have models to play with.
Now, I build a few very simple models, created by adding cubes to the scene and scaling and moving them to form something like a table:
4 cubes for the legs, 1 flat cube for the top, the 4 “legs” line up with the edge of the top cube at the edges.
I made triangles of the faces, exported and drew it, which works fine, normals and everything are OK. Now the model as simple as it is has of course some “flaws”:
- the top faces of the “legs” are not visible and unnecessary
- the exported file contains the description of 5 objects even though I use only one simple material for everything.
- there are double vertices, e.g. the outter top points of the legs are the same points as the lower bottom vertices of the top cube.
So the first thing I did was removing the top faces of the legs, exported and tested again, works.
Next I selected all the objects and merged them with Ctrl+J, then I removed double vertices (twice, first attempt removed nothing, second removed 4 vertices, I do not know why that is).
Nevertheless, the scene looks OK in Blender and if I display the normals they all point to the outside, but if I export now, the indexes of the triangles seemed to be messed up: only half of the model is visible, the rest is hidden.
After several times reloading and repeating only parts of the steps I figured that the order of indexes becomes messed up with merging the objects.
Is this an issue with the X3D exporter that comes with Blender or is there anything I can do to have the export correct, so have the indexes in the correct order that the normal would point outside? I searched the forum already and found somewhere that I should disable “double sided” everywhere, the only place where I found it (activated) was in the Mesh panel, but deactivation and exporting again had no effect.
Does anybody has an idea how to fix this?