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!
Game Programming

Avatar of undefined
Last Comment
rICHO LOU

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
sylwander

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
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

rICHO LOU

FALSE ITSN´T WORKS
Your help has saved me hundreds of hours of internet surfing.
fblack61