Results 1 to 9 of 9

Thread: UV/TexCoord transformations required?

  1. #1

    UV/TexCoord transformations required?

    I have been writing a collada importer, and things are going well, but I've got a problem with my UV's... in some cases they're rotated 90 degree's, and in some cases they're upside down (all in the same DAE file)

    In some cases the UV's are 90o degrees to the right, and in some cases they're upside down.
    t = 1 - s
    s = 1 - t
    fixes some cases (and breaks others)

    and
    t = 1 - t
    s = 1 - s
    fixes the upside down ones (and again, the 90o degree ones are still broken)

    I'm assuming the UV's exported from max are right, but for the life of me I cannot find a program to which will view this 60mb DAE file to verify the export is correct.

    I've searched extensively, learnt there is no texture matrix transformation support in the collada spec, and no hints that I need to do anything with the UVs...

    AFAIK I'm reading my UV's from the input/source/accessor correctly (it's a generic function and seems to be correct for normals and positions)

    Many of the nodes in the collada are rotated 90 degrees, but it seems silly if I need to apply node transformations to the UV mapping... but is that the case?

    I've checked through the sources and they all reference the texcoord source params as S,T (never say, T,S which I thought might be the case)...

    Can anyone suggest what might be wrong? or even point me to a tool that will import the DAE AND let me see the texture mapping?

    I'm aware TEXCOORD's and UV's arent the same thing, but I haven't found any documentation specifying how I might have to transform the TexCoords into UV's...

    Another note, I'm rendering through the direct3d FF pipeline (dx9) in case I've neglected to do something there...

    Any help appreciated!

  2. #2
    Senior Member
    Join Date
    Aug 2004
    Location
    California
    Posts
    771

    Re: UV/TexCoord transformations required?

    Quote Originally Posted by soylentgraham
    I'm assuming the UV's exported from max are right, but for the life of me I cannot find a program to which will view this 60mb DAE file to verify the export is correct.
    With so much variance in the exported data, I would suggest that you double check that assumption.
    Quote Originally Posted by soylentgraham
    Many of the nodes in the collada are rotated 90 degrees, but it seems silly if I need to apply node transformations to the UV mapping... but is that the case?
    Not sure what you mean here but 3ds Max is normally a Z_UP system, while COLLADA defaults to Y_UP. Check that the document's <COLLADA><asset><unit> element, if any, is being handled correctly.
    Quote Originally Posted by soylentgraham
    I've checked through the sources and they all reference the texcoord source params as S,T (never say, T,S which I thought might be the case)...
    The order of those param names doesn't change the ordering of the data as defined by the semantic regardless.
    Quote Originally Posted by soylentgraham
    Can anyone suggest what might be wrong? or even point me to a tool that will import the DAE AND let me see the texture mapping?
    "see the texture mapping"? ... try FX Composer or Rendermonkey
    Quote Originally Posted by soylentgraham
    Another note, I'm rendering through the direct3d FF pipeline (dx9) in case I've neglected to do something there...
    Could be something there because 3ds Max, D3D, and COLLADA all use different coordinate systems.

    3ds Max is right-handed with Z_UP.
    D3D is left-handed with Y_UP.
    COLLADA is right-handed with Y_UP.

    Also texture coordinates between D3D (top-left origin) and COLLADA (bottom-left origin) map differently.

  3. #3
    Junior Member
    Join Date
    Jan 2011
    Posts
    2

    Re: UV/TexCoord transformations required?

    Did you ever get a resolution for this? I'm currently in the same boat, where the Texture Coordinates are completely messed in an importer app I'm creating.

  4. #4

    Re: UV/TexCoord transformations required?

    Not yet I'm afraid, I'm busy working on something else, but hopefully getting back onto this in the next month or so...

  5. #5
    Senior Member
    Join Date
    Aug 2004
    Location
    California
    Posts
    771

    Re: UV/TexCoord transformations required?

    Btw what tool did you use to export your problem test file?

  6. #6
    Junior Member
    Join Date
    Jan 2011
    Posts
    2

    Re: UV/TexCoord transformations required?

    Quote Originally Posted by marcus
    Btw what tool did you use to export your problem test file?
    Mine was a sample DAE file from a tutorial I found on the net. I *believe* it was done in lightwave, but I'm not 100% sure.

  7. #7
    badfish
    Guest

    Re: UV/TexCoord transformations required?

    also experiencing a similar problem, where meshes are being exported out from Maya and their UVs are showing up rotated -90 degrees in Y.

    anyone have any thoughts?

  8. #8

    Re: UV/TexCoord transformations required?

    Quote Originally Posted by marcus
    Btw what tool did you use to export your problem test file?
    3DS Max

  9. #9
    Senior Member
    Join Date
    Aug 2004
    Location
    California
    Posts
    771

    Re: UV/TexCoord transformations required?

    Maya and Max use different coordinate systems. Check your settings in Maya for right or left -handed and the up-axis before exporting. If you're not requesting for a conversion the exported document should be the coordinate system as in Maya; and you should use that as a baseline to isolate what piece of software is breaking the texture coordinate orientation as part of the coordinate system conversion.

    FBX also has some bugs reported against it regarding up-axis conversion.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •