Finnally I have a working 3ds loader that uses opengl to render the mesh. Now I have a doubt: a material contains sometimes besides color information also a texture stored in a separate image file. Supposing I load and apply the image as texture to the polygon, how do I apply color information after that?
Loading 3ds files
Started by rogerdv, Aug 20 2003 06:56 PM
6 replies to this topic
#2
Posted 20 August 2003 - 07:09 PM
by enabling GL_COLOR_MATERIAL?
sorry, i have no exact idea what you want, and.. i haven't worked a whole lot with the opengl material system..
sorry, i have no exact idea what you want, and.. i haven't worked a whole lot with the opengl material system..
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....
-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....
#3
Posted 20 August 2003 - 07:15 PM
In a more simple way: I have a texture and an RGB color (3 bytes). How do I apply both to the same polygon?
#4
Posted 20 August 2003 - 07:26 PM
the texture with glTexCoord, the color with glColor..
when you enable GL_TEXTURE_2D or some other texture format, you'll disable the colours, or not, i don't remember.
if you don't see the color anymore, enable GL_MATERIAL_COLOR, i think that was the one..
when you enable GL_TEXTURE_2D or some other texture format, you'll disable the colours, or not, i don't remember.
if you don't see the color anymore, enable GL_MATERIAL_COLOR, i think that was the one..
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....
-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....
#5
Posted 21 August 2003 - 11:15 AM
You set ur glColor before applying hte texture. glTexcoord
Once you do that you will have nicely colored (compose) textures.
Take a look @ the Display lists tutorial by Nehe.
It uses the techinque to make the cubes in the pyramid look of different color but with same texture.
Once you do that you will have nicely colored (compose) textures.
Take a look @ the Display lists tutorial by Nehe.
It uses the techinque to make the cubes in the pyramid look of different color but with same texture.
#6
Posted 21 August 2003 - 12:59 PM
Indeed it works that way. Thanks.
#7
Posted 21 August 2003 - 08:02 PM
happy to helped...
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....
-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












