Loading 3ds files

9275cef0ad2f15ec1813d63b0c5b0fad
0
rogerdv 101 Aug 20, 2003 at 18:56

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?

6 Replies

Please log in or register to post a reply.

6ad5f8c742f1e8ec61000e2b0900fc76
0
davepermen 101 Aug 20, 2003 at 19:09

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..

9275cef0ad2f15ec1813d63b0c5b0fad
0
rogerdv 101 Aug 20, 2003 at 19:15

In a more simple way: I have a texture and an RGB color (3 bytes). How do I apply both to the same polygon?

6ad5f8c742f1e8ec61000e2b0900fc76
0
davepermen 101 Aug 20, 2003 at 19:26

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..

590e8bdac8129bd87b188df15e62d0e5
0
CyraX 101 Aug 21, 2003 at 11:15

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.

9275cef0ad2f15ec1813d63b0c5b0fad
0
rogerdv 101 Aug 21, 2003 at 12:59

Indeed it works that way. Thanks.

6ad5f8c742f1e8ec61000e2b0900fc76
0
davepermen 101 Aug 21, 2003 at 20:02

happy to helped…