Archived

This topic is now archived and is closed to further replies.

mofoj0e

Texturing

Recommended Posts

Hi, I'm writing a simple windmill assignment for my class. When i try to texture my windmill, the color of the texture is blue instead of the color of the picture, white(using .bmp). I've enable and disable(GL_TEXTURE_2D) everytime i begin and end my texture bindings. I know the details are very little but i dont know what else to add so you guys could help. Any clues? [edited by - mofoj0e on May 2, 2003 7:46:06 PM]

Share this post


Link to post
Share on other sites
use

glColor3f(1.0f,1.0f,1.0f); // Full Strength colours (ie. no tint/fade)

what it does (and I could be wrong) is multiply the colour in the texture by the above colour percent.. so 1,1,1 is full strength, and .5,.5,.5 is halfbright, aswell as you can boost the red and lower the green (or whatever else takes your fancy.


[edited by - jumpman on May 2, 2003 11:33:28 PM]

Share this post


Link to post
Share on other sites
Hi guys,

Thanks for your inputs guys. The glColor3f did it. I also have another problem..

When I load the textures:

UINT g_Texture[10];

// **NEW** TEXTURES LOADING AREA(from digiben''s tutorial)
////////////////////////////////////////////////////////////
CreateTexture(&g_Texture[0], "grass.bmp", 0);
CreateTexture(&g_Texture[1], "shingles.bmp", 1);

When I''m using the grass texture:
"glBindTexture(GL_TEXTURE_2D, g_Texture[0]);"

it was fine, but when i was trying to use the shingle texture:
glBindTexture(GL_TEXTURE_2D, g_Texture[1]);
glBegin(GL_QUADS);
....

glEnd();
Then nothing shows up.

but when I use "glBindTexture(GL_TEXTURE_2D, g_Texture[2]);"
it works fine.

I''m thinking it''s the size of the texture that''s the problem but im not sure. I hope it''s not too confusing.

mofoj0e




Share this post


Link to post
Share on other sites
if you used the loading code from nehe Ipicture then it will ensure that all your textures are of mod 2 (so you can load anything and it will auto-correct it for you..)

offcourse you should be able to tell if your shingles.bmp is the correct size..

i''ve not seen the CreateTexture function but shouldn''t the last parameter be 0 ?? ie..

CreateTexture(&g_Texture[1], "shingles.bmp", 0);

as you are already specifing a different Texture ID pointer.

actually on a related note.. I just sent off my texture loading functions which will auto load TGA, BMP, JPG, GIF from the same interface and handles all the alpha conversions to Nehe..

Share this post


Link to post
Share on other sites