Archived

This topic is now archived and is closed to further replies.

are my normals wrong?

This topic is 5847 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i think i did everything right when i use glNormal3f but it seems as if all the sides of my cubes look the same( same amount of light), i enabled all the lights and lighting maybe u can help me, here is some of the drawing code: glBegin(GL_QUADS); // Start drawing quads glNormal3f( 0.0f, 0.0f, -1.0f); // Light facing viewer glTexCoord2f( 0.0f, 1.0f); // Top left part of texture glVertex3f( -1.0f, 1.0f, 0.0f); // Top left point (front face) glTexCoord2f( 0.0f, 0.0f); // Bottom left part of texture glVertex3f( -1.0f, -1.0f, 0.0f); // Bottom left point (front face) glTexCoord2f( 1.0f, 0.0f); // Bottom right part of point glVertex3f( 1.0f, -1.0f, 0.0f); // Bottom right point (front face) glTexCoord2f( 1.0f, 1.0f); // Top right of texture glVertex3f( 1.0f, 1.0f, 0.0f); // Top right point (front face) glNormal3f( 1.0f, 0.0f, 0.0f); // Light facing right of viewer glTexCoord2f( 0.0f, 1.0f); // Top left part of texture glVertex3f( 1.0f, 1.0f, 0.0f); // Top Left point(right face) glTexCoord2f( 0.0f, 0.0f); // Bottom left part of texture glVertex3f( 1.0f, -1.0f, 0.0f); // Bottom left point (right face) glTexCoord2f( 1.0f, 0.0f); // Bottom right part of point glVertex3f( 1.0f, -1.0f, 2.0f); // Bottom right point (right face) glTexCoord2f( 1.0f, 1.0f); // Top right of texture glVertex3f( 1.0f, 1.0f, 2.0f); // Top right point (right face) glNormal3f( 0.0f, 0.0f, 1.0f); // Light facing away from viewer glTexCoord2f( 0.0f, 1.0f); // Top left part of texture glVertex3f( -1.0f, 1.0f, 2.0f); // Top left point (back face) glTexCoord2f( 0.0f, 0.0f); // Bottom left part of texture glVertex3f( -1.0f, -1.0f, 2.0f); // Bottom left point (back face) glTexCoord2f( 1.0f, 0.0f); // Bottom right part of point glVertex3f( 1.0f, -1.0f, 2.0f); // Bottom right point (back face) glTexCoord2f( 1.0f, 1.0f); // Top right of texture glVertex3f( 1.0f, 1.0f, 2.0f); // Top right point (back face) glNormal3f( -1.0f, 0.0f, 0.0f); // Light facing left of viewer glTexCoord2f( 0.0f, 1.0f); // Top left part of texture glVertex3f( -1.0f, 1.0f, 0.0f); // Top Left point(left face) glTexCoord2f( 0.0f, 0.0f); // Bottom left part of texture glVertex3f( -1.0f, -1.0f, 0.0f); // Bottom left point (left face) glTexCoord2f( 1.0f, 0.0f); // Bottom right part of point glVertex3f( -1.0f, -1.0f, 2.0f); // Bottom right point (left face) glTexCoord2f( 1.0f, 1.0f); // Top right of texture glVertex3f( -1.0f, 1.0f, 2.0f); // Top right point (left face) glNormal3f( 0.0f, 1.0f, 0.0f); // Light facing top of viewer glTexCoord2f( 0.0f, 1.0f); // Top left part of texture glVertex3f( 1.0f, 1.0f, 0.0f); // Top left point (top face) glTexCoord2f( 0.0f, 0.0f); // Bottom left part of texture glVertex3f( 1.0f, 1.0f, 2.0f); // Bottom left point (top face) glTexCoord2f( 1.0f, 0.0f); // Bottom right part of point glVertex3f( -1.0f, 1.0f, 2.0f); // Bottom left point (top face) glTexCoord2f( 1.0f, 1.0f); // Top right of texture glVertex3f( -1.0f, 1.0f, 0.0f); // Top right point (top face) glNormal3f( 0.0f, -1.0f, 0.0f); // Light facing bottom of viewer glTexCoord2f( 0.0f, 1.0f); // Top left part of texture glVertex3f( 1.0f, -1.0f, 0.0f); // Top left point (top face) glTexCoord2f( 0.0f, 0.0f); // Bottom left part of texture glVertex3f( 1.0f, -1.0f, 2.0f); // Bottom left point (bottom face) glTexCoord2f( 1.0f, 0.0f); // Bottom right part of point glVertex3f( -1.0f, -1.0f, 2.0f); // Bottom left point (bottom face) glTexCoord2f( 1.0f, 1.0f); // Top right of texture glVertex3f( -1.0f, -1.0f, 0.0f); // Top right point (bottomface) glEnd(); plz hlp "Those who serve no purpose, have no purpose"

Share this post


Link to post
Share on other sites