I 'm not able to aply the texture to my 3D object

Started by
18 comments, last by hellsinn0 19 years, 11 months ago
I believe you need to enable GL_TEXTURE as well as GL_TEXTURE_2D?
Advertisement
quote:Original post by Raduprv
Yes, ID==0 means baaaad
Like I said, make your own texture loading function (check the NeHe tutorials).


could you tell me exactly where to find it, an easy way I mean. It just mean to me a bounch of code lines and I don''t know exactly what I need to make my own loader.
By the way, why am I getting ID=0? if I''m loading the texture in the same way than in the example??

:P
quote:Original post by MaulingMonkey
I believe you need to enable GL_TEXTURE as well as GL_TEXTURE_2D?


No, you don''t have to.
I don''t even think GL_TEXTURE exists.
heyyyyyyyyyyyyyy , I got a diferent number!!! yeahhh

ok, my fisrt error was==> I was loading the texture before CREATE THE WINDOW!!!! uppss...didn''t think it was important!!! as you guys can see I''m totally bad in this...ok now I''m getting after loading the texture ID=5, let''s see if it works now!!! I''ll let you know it!! hehehehe :D
:P
quote:Original post by Raduprv
I don''t even think GL_TEXTURE exists.


It''s defined as 0x1702... at least in my version of gl.h.

I could''ve sworn that fixed the problem I was having once, but then again, it''s quite possible I modified something else at the same time.
it''s not working!!! why????
I don''t understand anything.....I''m getting an ID=5, but when binding the texture I just can see a totally plane white circle shape. If don''t bind the texture at least a can see the 3D sphere!!! I''m desperated!!
:P
One thing I noticed is that when you first load your texture, you're using mipmaps to build your texture:

gluBuild2DMipmaps(GL_TEXTURE_2D,3,Image->sizeX,
Image->sizeY,GL_RGB, GL_UNSIGNED_BYTE,Image->data);


However, you're specifying GL_LINEAR for both *MIN_FILTER and *MAG_FILTER. I'm not sure if this would cause the problem, but try using this instead of gluBuild2DMipmaps:

glTexImage2D(GL_TEXTURE_2D, 0, 3, Image->sizeX,
Image->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, Image->data);

~Urayami

[edited by - urayami on May 20, 2004 3:12:04 PM]
~Urayami
quote:Original post by hellsinn0
it''s not working!!! why????
I don''t understand anything.....I''m getting an ID=5, but when binding the texture I just can see a totally plane white circle shape. If don''t bind the texture at least a can see the 3D sphere!!! I''m desperated!!


Is your texture now a power of 2 in size? thats generally what you get when the texture isnt a power of 2 in size.
GUYS!!!!!!! I could make it!!! guys!!!!! and don't know why but this thing suddenly worked !!!!


now, I'm able to see the texture in the simple sphere...so my challenge will be mapping different textures in a virtual laboratory I have made using 3ds max. wish me luck!!! otherwise I'll be around here bothering people, you guys. Thanks a lot to all you guys!!!

sincerely

Begoña.- the happiest one, right now!! hehe yeeeep!!

by the way....I can also render bmp files that are not power of 2!!! isn't it weird???

[edited by - hellsinn0 on May 20, 2004 4:06:53 PM]

the last thing...is it normal to loose the shading efects?? now when I'm able to see the texture, the sphere looks kinda artificial, i don't have shades any more

[edited by - hellsinn0 on May 20, 2004 4:21:56 PM]
:P
no problem, I got it. thanks

:P

This topic is closed to new replies.

Advertisement