PDA

View Full Version : OpenGL Super Bible gltMakeCube question



Craig Ching
01-24-2011, 02:52 PM
Hi!

Newbie to graphics programming. In the OpenGL Superbible 5th Edition, there's a function gltMakeCube(GLBatch& cubeBatch, GLfloat fRadius) that has the following for vertices and texture coordinates:



cubeBatch.MultiTexCoord2f(0, fRadius, fRadius);
cubeBatch.Vertex3f(fRadius, fRadius, fRadius);


the question I have is why are the texture coordinates specified as fRadius instead of 0.0f or 1.0f? There must be a reason for this, right?

I decided that that didn't work for me so I made my own function that used 0 or 1 and that worked for me, I was able to get the textures to look like I expected, but I want to understand why it was done this way if it's not a mistake.