#109292 - Dan Forever - Thu Nov 16, 2006 11:40 pm
I'm having a problem when it comes to drawing a quad on an orthogonal view.
With a width and height of upto 7, the quad draws correctly. If I have a size on either axes of 8 or larger, it inverts on those axes.
so a quad at x 10.0 with a width of 5 will correctly have it's left at 10 and right at 15, but a width of 8 will have the left at 2 and right at 10.
Are floats one byte fixed point real numbers, or is there something inherently wrong with my drawing code?
With a width and height of upto 7, the quad draws correctly. If I have a size on either axes of 8 or larger, it inverts on those axes.
so a quad at x 10.0 with a width of 5 will correctly have it's left at 10 and right at 15, but a width of 8 will have the left at 2 and right at 10.
Are floats one byte fixed point real numbers, or is there something inherently wrong with my drawing code?
Code: |
void RenderManager::Draw(Renderable& quad)
{ if(quad.texID == NO_TEXTURE && quad.texID < NUM_TEXTURES) glBindTexture(GL_TEXTURE_2D, 0); // No Texture else glBindTexture(GL_TEXTURE_2D, m_texture[quad.texID]); // Texture glColor3b(quad.red, quad.green, quad.blue); glTranslatef(quad.x, quad.y, 0.0f); glBegin(GL_QUADS); // Draw A Quad glTexCoord2f(quad.uv[0][0], quad.uv[0][1]); // Top Left glVertex3f(quad.width, 0.0f, 0.0f); // Top Right glTexCoord2f(quad.uv[1][0], quad.uv[0][1]); // Top Right glVertex3f(quad.width, quad.height, 0.0f); // Bottom Right glTexCoord2f(quad.uv[1][0], quad.uv[1][1]); // Bottom Right glVertex3f(0.0f, quad.height, 0.0f); // Bottom Left glTexCoord2f(quad.uv[0][0], quad.uv[1][1]); // Bottom Left glVertex3f(0.0f, 0.0f, 0.0f); // Top Left glEnd(); // Done Drawing The Quad } |