View Full Version : I need help texturing a glutSolidCube

11-12-2001, 02:38 PM
Can anyone provide me with some code on how I can map a .bmp or .tga texture file (say, 128*128 or 256*256) onto a glutSolidCube object? Rewriting my program to use GL_QUADS isn't an option. I've spent all day looking for info on this, and it sounds like it's possible but I can't find any code. http://www.opengl.org/discussion_boards/ubb/confused.gif


Rob The Bloke
11-13-2001, 07:42 AM
You can only texture glutSolidTeapot because its the only one with texturing co-ordinates

11-13-2001, 07:56 AM
Use GLU to create a cube instead, then you can enable texture coordinate generation.

11-13-2001, 06:03 PM
Thanks Bob, do you have a link with info on how to do this?

11-14-2001, 12:27 AM
Hmm, seems like GLU doesn't draw cubes...

Either you must draw the cube yourself, or use OpenGL's automatic texturecoordinate generation.

For automatic texturecoorinate generation, check out the Red Book (http://ask.ii.uib.no/ebt-bin/nph-dweb/dynaweb/SGI_Developer/OpenGL_PG/) , chapter 9. And by the way, why can't you draw the cube yourself?

11-14-2001, 05:10 AM
I'll look into redrawing all the cubes in my program, it might not require me to rewrite most of my functions as I first though.

Thanks for the help.