I’m attempting to make a chromed cube in GLUT / OpenGL and I’m not sure exactly how to do it.
I looked up a ‘Materials Table’ in a textbook which showed ‘Chrome’ as being: Ambient: (0.25, 0.25, 0.25), Diffuse: (0.4, 0.4, 0.4), and Specular: (0.774597,0.774597,0.774597).
My question is, how do I create a simple cube and apply this material/texture to it in Glut/OpenGL?
Do I use ‘glutSolidCube()’? If so, how do I then apply the chrome texture to it?
Can any GLUT/OpenGL people point me in the right direction?
This should be as simple as calling
glMaterialfv()beforeglutSolidCube().I haven’t done OpenGL since school, but here’s some display loop code from an old project that used a sphere that should get you on the right track: