- Home /
Exporting OBJ WITH transform information
Using the ObjExporter http://wiki.unity3d.com/index.php/ObjExporter (modifying it so it works correctly), I export a mesh/skinned mesh to an OBJ. This works. But the transformation information (position, rotation, and scale) does not export with it. How would I apply the transform information to the OBJ exporting process?
EDIT: I seem to have gotten one step closer: using transform.TranformPoint does transform the point of non-skinned meshes to the proper transform. But skinned meshes seem to rotate strangely.
//Where m is the mesh and r is the renderer
foreach(Vector3 v in m.vertices)
{
Vector3 vec = r.transform.TransformPoint(v.x,v.y,v.z);
sb.Append(string.Format("v {0} {1} {2}\n",-vec.x,vec.y,vec.z));
}
Edit 2: I think it may have something to do with pivot points, but I am not sure. How would I adjust it to the pivot point along with the rest of the transform?
Comment