[fixed]OBJ reader and writer disagree on Y texcoords

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

[fixed]OBJ reader and writer disagree on Y texcoords

Post by hendu »

The OBJ reader flips the Y texcoord by doing (1 - y). The OBJ writer does it by negation, (-y).

This means that processing the same OBJ through irr several times will each time change the Y texcoord: 0 > -1 > -2 > -3...


I believe both approaches are fragile, in properly handling repeating and negative texcoords. For "normal" texcoords that only go 0 to 1, something like this would work: https://github.com/clbr/seirr/commit/1a ... b5ca64d264
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: OBJ reader and writer disagree on Y texcoords

Post by hybrid »

I've only changed the obj writer, as the fabsf would again introduce too many changes in consecutive conversions.
Post Reply