- Home /
Why do you need to invert the X value during mesh export?
I've been using the ExportOBJ script from the Unify wiki for some time now, but I've since realized that meshes exporting from it our flipped so you get a kind of mirror image version of the model. When I searched around a little, I found that Unify Wiki has another OBJ exporter script, and the main difference I saw was that it inverts the x coordinate of the vertex.
Vector3 wv = mf.transform.TransformPoint(lv);
//This is sort of ugly - inverting x-component since we're in
//a different coordinate system than "everyone" is "used to".
sb.Append(string.Format("v {0} {1} {2}\n",-wv.x,wv.y,wv.z));
But it confesses in the comments that "this is sort of ugly." What is going on here? Nevertheless, the script worked correctly. For my own edification, I'm trying to figure out what's going on in this script. Why the need to invert the X vertex? And what makes it"ugly"? Is there a better way?
ObjExporter script // This one works, sorta
Answer by Jeff-Kesselman · May 23, 2014 at 04:06 PM
There are two different ways to do 3D coordinate systems... "left handed" systems and "right handed" systems. Not all 3D packages use the same one.
For more information read this:
Your answer
Follow this Question
Related Questions
Blender to unity issue 1 Answer
Unity importing Mesh as a Game Object Group?? 0 Answers
Combine meshes result in a larger file size on export (GLTF) 1 Answer
Get height of a Mesh by X and Z coordinates 1 Answer
3DS Max FBX Turbosmooth export 1 Answer