Jump to content
  • Advertisement
Sign in to follow this  
Tingle

Inverted Texture after loading from Obj?

This topic is 2658 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I created an .obj importer for my DirectX D3D9 app. Ive flipped the X and Z of the .obj to make it Left Handed like DirectX is, and flipped the U,V's 'v'. But my texture on the mesh seems inverted in its self and not as if it was Flipped on the 'u'. This is what I get:
http://img844.imageshack.us/img844/7957/74014671.png

as you can see, all letters are inversed. Wich is not the case in Maya

Share this post


Link to post
Share on other sites
Advertisement

Just flip the "u"'s


texC.x = 1 - texC.x;



Doing this results in flipping the whole texture coords. This sets the texture around correctly, but the UV's are no longer in place where they should be.
I can correct my base problem manualy in Maya by clicking on each "UV" layout element and fliping it. So basicly reproducing this mirrored effect in maya so it will turn out correctly in my D3D App. But shouldnt there be a reason why this is mirrored in its self? Its as if the Texture was looking at itsself in a mirror...

Now by doing what you told me to, I get this:
http://img821.images...89/71708228.png


So to sum up what I did to the original obj mesh data:
I fliped the X & Z of the Vertecies, the X & Z of the Normals, and the U & V of the texture coords

Share this post


Link to post
Share on other sites
If the texture is applied symmetrically to the mesh, you should be able open the texture in Photoshop or even Paint and flip it horizontally (or vertically). Then save it.

Share this post


Link to post
Share on other sites
I think you guys are missing the point...?
The texture is INVERTED in its SELF. Meaning that not the whole texture is "flipped" in some direction, but the UV Element/Pieces/Layout/Shit-Terds or what every you want to call it, Are flipped in thier own position.
See:

Texture with UV:
http://img705.images...16/61742628.png

Is equal to this in Maya:
http://img841.images...16/42089178.png

Is equal to this after exported to .obj and loaded into my D3D App after altering some things ( fliped the X & Z of the Vertecies, the X & Z of the Normals, and the V of the texture coords ):
http://img651.images...00/75162327.png


NOW, lets take alook at the UV's. It seems that the UV "Elements as you can see on Pic 1 are correct in Maya, but pretty much inversed in them selfs in my App? This is by no way logicly possible if you think about it, its as iff the mesh is inside out, but this wouldnmt be possible because if it was, the mesh would be only rendering the inside?.

Share this post


Link to post
Share on other sites
Ok, I found a solution. I set the culling mode to draw clockwise and inverted only the Z coords on the mesh, turning the mesh inside out and rendering it inside out... This sound stupid? Or is it a correct approach?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!