How Do I Bind a Texture to a GLUT Object?

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

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.

Thanks,

Cheers,

Chris