Link to home
Start Free TrialLog in
Avatar of TonyTigerHearty
TonyTigerHearty

asked on

Binding a texture "*.bmp" to glutSolidCube?

Please somebody help me!

Is it possible to use textures on glutSolidCube/glutWireCube and glutSolidSphere/glutWireSphere?

Cheers Tony!
ASKER CERTIFIED SOLUTION
Avatar of sylwander
sylwander

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kfarhang
kfarhang

I had this same exact problem, none of the solutions i was finding online worked, but this chunk of code works like a charm:


glBindTexture(GL_TEXTURE_2D, texture2);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glutSolidSphere(1.0, 35.0, 35.0);

Open in new window

FALSE ITSN´T WORKS