PDA

View Full Version : How Do I Bind a Texture to a GLUT Object?



cpsmusic
01-12-2006, 08:56 AM
Hi,

I'd like to bind a texture to a glutSolidCube.

When I tried to do this, the colour of the object changed, however the texture was not drawn.

I imagine this is something to do with the texture coordinates not being set properly.

Is there a tutorial anywhere that explains how to bind a texture to a glut object, especially how to control the texture coordinates.

Cheers,

Chris

dorbie
01-12-2006, 09:11 AM
You need to supply texture coordinates with the cube vertices.

Drawing your own cube is very simple, a useful learning exercise, I suggest you do that instead of using GLUT rendering functions which are mostly useless except for trivial demos.

cpsmusic
01-12-2006, 12:27 PM
Thanks,

Cheers,

Chris