Jump to content


3ds with max's texture coordinates


32 replies to this topic

#1 urika

    Member

  • Members
  • PipPip
  • 54 posts

Posted 10 August 2003 - 01:20 PM

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?

#2 anubis

    Senior Member

  • Members
  • PipPipPipPip
  • 2225 posts

Posted 10 August 2003 - 06:52 PM

well, without seeing any code it's hard to help you
If Prolog is the answer, what is the question ?

#3 urika

    Member

  • Members
  • PipPip
  • 54 posts

Posted 12 August 2003 - 07:55 AM

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 :blush:
while i m looking 4 a solution myself i came across glTexCoordPointer
does this have something to do with it (or something like it)?

#4 anubis

    Senior Member

  • Members
  • PipPipPipPip
  • 2225 posts

Posted 12 August 2003 - 12:26 PM

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 ;)
If Prolog is the answer, what is the question ?

#5 urika

    Member

  • Members
  • PipPip
  • 54 posts

Posted 12 August 2003 - 01:55 PM

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:

#6 anubis

    Senior Member

  • Members
  • PipPipPipPip
  • 2225 posts

Posted 12 August 2003 - 03:02 PM

try to find out about opengl vertex buffers. you might want to google for the "opengl red book"
If Prolog is the answer, what is the question ?

#7 urika

    Member

  • Members
  • PipPip
  • 54 posts

Posted 14 August 2003 - 12:48 PM

here is some code that i think should texture correctly but doesnt
if(pObject->bHasTexture)
{

// Make sure there was a UVW map applied to the object or else it won't have tex coords.
if(pObject->pTexVerts)
{
glTexCoord2f(pObject->pTexVerts[ index ].x, pObject->pTexVerts[ index ].y);
}
}


i assume the info in pTexVerts is correct but still it doesnt texturize correctly

#8 urika

    Member

  • Members
  • PipPip
  • 54 posts

Posted 24 August 2003 - 09:00 AM

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:

#9 davepermen

    Senior Member

  • Members
  • PipPipPipPip
  • 1306 posts

Posted 24 August 2003 - 11:04 AM

how "different"? mirrored or what?

i don't know. we never had such problems, it... just worked.. :|
davepermen.net
-Loving a Person is having the wish to see this Person happy, no matter what that means to yourself.
-No matter what it means to myself....

#10 urika

    Member

  • Members
  • PipPip
  • 54 posts

Posted 24 August 2003 - 12:06 PM

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:

#11 davepermen

    Senior Member

  • Members
  • PipPipPipPip
  • 1306 posts

Posted 24 August 2003 - 05:27 PM

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..
davepermen.net
-Loving a Person is having the wish to see this Person happy, no matter what that means to yourself.
-No matter what it means to myself....

#12 urika

    Member

  • Members
  • PipPip
  • 54 posts

Posted 28 August 2003 - 08:34 AM

it works!!!!
the problem was this:
there was glTexCoord2f(pObject->pTexVerts[ind].x, pObject->pTexVerts[ind].y);
and when i changed it to
glTexCoord2f(pObject->pTexVerts[ind].x, -pObject->pTexVerts[ind].y);
it works (the "-" made the differance).
i dont exactly understand why...
can any one enlighten me? B)

#13 anubis

    Senior Member

  • Members
  • PipPipPipPip
  • 2225 posts

Posted 28 August 2003 - 08:52 AM

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...
If Prolog is the answer, what is the question ?

#14 davepermen

    Senior Member

  • Members
  • PipPipPipPip
  • 1306 posts

Posted 29 August 2003 - 07:34 AM

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..)
davepermen.net
-Loving a Person is having the wish to see this Person happy, no matter what that means to yourself.
-No matter what it means to myself....

#15 anubis

    Senior Member

  • Members
  • PipPipPipPip
  • 2225 posts

Posted 29 August 2003 - 08:17 AM

hey... that might be the solution... why didn't i think of that ???
i bet he's using targas for textures...
If Prolog is the answer, what is the question ?

#16 urika

    Member

  • Members
  • PipPip
  • 54 posts

Posted 31 August 2003 - 10:03 AM

the texture format is jpg , i dont know what is "targas".
my loader is basically from gametutorials.com

#17 baldurk

    Senior Member

  • Members
  • PipPipPipPip
  • 1057 posts

Posted 31 August 2003 - 10:09 AM

The Targa image format is quite common. The file extension is generally .tga
baldurk
He who knows not and knows that he knows not is ignorant. Teach him.
He who knows not and knows not that he knows not is a fool. Shun him.

#18 anubis

    Senior Member

  • Members
  • PipPipPipPip
  • 2225 posts

Posted 31 August 2003 - 10:27 AM

and very often they are stored upside-down
If Prolog is the answer, what is the question ?

#19 urika

    Member

  • Members
  • PipPip
  • 54 posts

Posted 01 September 2003 - 08:00 AM

nope, jpg

#20 davepermen

    Senior Member

  • Members
  • PipPipPipPip
  • 1306 posts

Posted 01 September 2003 - 12:12 PM

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..
davepermen.net
-Loving a Person is having the wish to see this Person happy, no matter what that means to yourself.
-No matter what it means to myself....





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users