Why does unity obj import flip my x coordinate?

Posted by milkplus on Game Development See other posts from Game Development or by milkplus
Published on 2012-10-14T00:32:02Z Indexed on 2012/10/14 3:52 UTC
Read the original article Hit count: 236

Filed under:
|
|
|
|

When I import my wavefront obj model into unity and then draw lines over it with the same coordinates in the obj file, the x coordinate is negated.

I don't see any option in the importer that might be doing that. And I'm using the same localToWorldMatrix and the same coordinate data in the .obj file. Hmmm

GL.PushMatrix();
GL.MultMatrix(transform.localToWorldMatrix);

CreateMaterial();
lineMaterial.SetPass(0);

GL.Color(new Color(0, 1, 0));
GL.Begin(GL.LINES);

GL.Vertex(p1);
GL.Vertex(p2);

GL.Vertex(p2);
GL.Vertex(p3);

//...

GL.End();
GL.PopMatrix();

© Game Development or respective owner

Related posts about c#

Related posts about 3d