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?
well, without seeing any code it's hard to help you
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)?
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
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:
try to find out about opengl vertex buffers. you might want to google for the "opengl red book"
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
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:
how "different"? mirrored or what?
i don't know. we never had such problems, it... just worked..
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:
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..
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)
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...
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..)
hey... that might be the solution... why didn't i think of that ???
i bet he's using targas for textures...
the texture format is jpg , i dont know what is "targas".
my loader is basically from gametutorials.com
The Targa image format is quite common. The file extension is generally .tga
and very often they are stored upside-down
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 →