The texture v-coordinates in the OBJ mesh loader are negated (i.e. v = -v) in COBJMeshFileLoader.cpp:585 (version 1.4.2), causing typical v coordinates to lie outside the 0-1 range. Consequently, non-wrapping texturing modes will cause unexpected results/problems when used on OBJ meshes. This can also be problem for complex uv-manipulating shaders. Please note that this implementation differs from, for example, C3DSMeshFileLoader.cpp:987, which flips (i.e. v = 1-v) the v component.
A simple fix, then, would be to change COBJMeshFileLoader.cpp:585 from:
vec.Y=-core::fast_atof(wordBuffer); // change handedness
to:
vec.Y=1-core::fast_atof(wordBuffer); // change handedness
Giliam
[fixed] OBJ loader texcoord bug
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Welcome to the community! Can I get you a beer? 3DModellerGuy, get this man a beer.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way