lwjgl - Incorrectly applied textures -
i'm kinda new this, i'm stumped. create simple model of card in blender single face , texture, export .obj when load lwjgl texture not backwards applied incorrectly.

the texture coordinates in obj file should correct(even if rounded them down 0 , 1), can see...
# blender v2.67 (sub 0) obj file: '' # www.blender.org mtllib x.mtl o plane v 0.5 0.000000 1.000000 v -0.5 0.000000 1.000000 v 0.5 0.000000 -1.000000 v -0.5 0.000000 -1.000000 vt 0 0 vt 1 0 vt 1 1 vt 0 1 vn 0.000000 1.000000 -0.000000 usemtl material.002 s off f 2/1/1 1/2/1 3/3/1 f 4/4/1 2/1/1 3/3/1 
now manually adjusted coordinates , seem work, it's till backwards.
# blender v2.67 (sub 0) obj file: '' # www.blender.org mtllib x.mtl o plane v 0.5 0.000000 1.000000 v -0.5 0.000000 1.000000 v 0.5 0.000000 -1.000000 v -0.5 0.000000 -1.000000 vt 0 0 vt 0.78 0 vt 0.78 0.585 vt 0 0.585 vn 0.000000 1.000000 -0.000000 usemtl material.002 s off f 2/1/1 1/2/1 3/3/1 f 4/4/1 2/1/1 3/3/1 is problem on blender side(i set stuff wrong there) or lwjgl(i set other stuff wrong there)? though seem have similar problem models made other people. btw i'm using slick load textures(but other methods resulted in same bug).

this last textured model made , imported same way, texture seams correctly applied... it's upside down though. textures applied upside down not 'mirrored' left-to-right.
update 1
it's weird... did little experiment , found weird results. textures: 512x512: ok, 1024x1024: ok, 1024x512: ok, 512x1024: ok, 512x256: ok, 256x512: ok, 800x600: wrong, 600x800: wrong. magnitudes of 2(hope it's correct term) work. read textures slick/lwjgl have have dimensions dividable 2(even remember why), why coordinates applied wrongly @ dimensions?
tried different order of coordinates... texture still upside-down(or sideways). , if import obj file blender go edit mode , unwrap textured face... flips upside-down in there too.
update 2
as understand, how texture coordinates should work:

somehow this:

am correct? problem hinders awesome game-making. texture dimensions problem still on table too. please help.
update 3
thanks neomonkeus upside-down texture problem fixed. how texture dimension problem? there "gltexparameteri()" command fix it? ore there wrong texture matrix?
i'm stupid. it's power of 2 thing. question asked , answered thoroughly. weird thing is, @ point textures scaled correctly... don't remember method used load them. while upside-down thing can fixed '1-v' method, shouldn't appear when copy-paste code www.lwjgl.org.
edit
once again, i'm stupid. if glortho(0,800,600,0,1,-1) texture flipped again, wright-side up. not stupid question, old , basic 1 well. make clear... if want have textures oriented same way in perspective , orthographic view, have have 0.0 in lower-left corner, wright?
btw: slicks textureloader.gettexture(...) flipped param should flip image on load, same result true , false. what's that?
Comments
Post a Comment