urika at August 10th, 2003 09:20 — #1
i loaded a 3ds object into my program , i managed to load the texture as well but not as i mapped it in 3d studio max 5
the "preserve max's texture coordinates" is checked but still it kinda puts the jpg on the object without mapping
can anyone help?
anubis at August 10th, 2003 14:52 — #2
well, without seeing any code it's hard to help you
urika at August 12th, 2003 03:55 — #3
its basicly the 3ds loader from gametutorials (that can also read jpeg)
i changed the 3ds object to mine.
i can post code but since i dont know where the problem is i dont really know what to post while i m looking 4 a solution myself i came across glTexCoordPointer
does this have something to do with it (or something like it)?
anubis at August 12th, 2003 08:26 — #4
well, if you pass glTexCoordPointer the texture coordiantes from your max file i don't know why it doesn't work. it looks like some small bug in your code... which i can't fix for you
urika at August 12th, 2003 09:55 — #5
i did not use glTexCoordPointer yet!
i just saw it in the msdn help as i was looking for a solution.
can anyone post some code with glTexCoordPointer?
or just tell me where i can find something helpful.. :nod:
anubis at August 12th, 2003 11:02 — #6
try to find out about opengl vertex buffers. you might want to google for the "opengl red book"
urika at August 14th, 2003 08:48 — #7
here is some code that i think should texture correctly but doesnt
// Make sure there was a UVW map applied to the object or else it won't have tex coords.
glTexCoord2f(pObject->pTexVerts[ index ].x, pObject->pTexVerts[ index ].y);
i assume the info in pTexVerts is correct but still it doesnt texturize correctly
urika at August 24th, 2003 05:00 — #8
after working on it and changing the order of things , the texture appears on the object but not as in 3d studio max, why ????? is there something in max that i need to change? :blink:
davepermen at August 24th, 2003 07:04 — #9
how "different"? mirrored or what?
i don't know. we never had such problems, it... just worked..
urika at August 24th, 2003 08:06 — #10
first of all thanks for trying.
my object is a jet fighter, in max i put a texture using unwrap uvw so it would look lifelike.
when i use the object in opengl , it uses the same jpg allright but the coordinates have moved , for instance the back fin texture is smeared on the wing.
i don't know WHERE the problem is openGL? Max?(it looks good in max) :eek:
davepermen at August 24th, 2003 13:27 — #11
hm.. comparison pics (hint: my webspace for hosting), or actual loading code could help i guess.. difficult without any info on WHAT is wrong, or HOW its wrong..
urika at August 28th, 2003 04:34 — #12
the problem was this:
there was glTexCoord2f(pObject->pTexVerts[ind].x, pObject->pTexVerts[ind].y);
and when i changed it to
it works (the "-" made the differance).
i dont exactly understand why...
can any one enlighten me? B)
anubis at August 28th, 2003 04:52 — #13
max has strange ways of dealing with coordinates in general... y - z axis mixed up, etc. i wouldn't know y it should store negative texture coordinates. also i never had that problem...
davepermen at August 29th, 2003 03:34 — #14
hm... very weird.. what format is the texture? and what do you use to load it?
because some images are known to be stored "topdown" => you have to flip the y-coord (actually you have to calc 1-ycoord, but if you have GL_REPEAT, result is the same..)
anubis at August 29th, 2003 04:17 — #15
hey... that might be the solution... why didn't i think of that ???
i bet he's using targas for textures...
urika at August 31st, 2003 06:03 — #16
the texture format is jpg , i dont know what is "targas".
my loader is basically from gametutorials.com
baldurk at August 31st, 2003 06:09 — #17
The Targa image format is quite common. The file extension is generally .tga
anubis at August 31st, 2003 06:27 — #18
and very often they are stored upside-down
urika at September 1st, 2003 04:00 — #19
davepermen at September 1st, 2003 08:12 — #20
well, all i know is jpg and bmp are upsidedown with relation to eachother.. i always "loved" that in DevIL.. but you could set there a mode to lode in the correct orientation..
i guess its that.. flip your jpgs..
next page →