I wrote a little obj exporter. Works fine. Problem is that the export is mirrored because of the left handed vs right handed coordinate issue.
Okay, making the x direction of the mesh inverted by *-1 mirrors it back.
obj.WriteLine("v {0} {1} {2}",-t.x,t.y,t.z);
But then the normals are flipped. So i need to flip the normals too.
I had then a look at the available Obj exporter in the Unify wiki. There the normals gets inverted by minus 1 too. So i wrote: obj.WriteLine("vn {0} {1} {2}",-wv.x,wv.y,wv.z);
Didn’t help. The normals are still flipped.
And that’s where i am stuck at the moment. My code looks basically equal to the code in the wiki as far as i can tell. Only difference is that my code is JS while the code in the Wiki is C#. But this shouldn’t be the problem. And my version arrives with flipped normals. So i obviously miss something important. I do something wrong.
Could somebody please give me a hint where i am wrong here? How do i flip my normals so that my faces points upwards again?
Attached is a very reduced example file. Just the export code at an object. The created obj file can be found at C