lecture4 - CSE472 Computer Graphics Vertex normals, texture...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CSE472 Computer Graphics Vertex normals, texture mapping, holes, vertex issues Vertex normals Texture mapping Holes Vertex issues
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 CSE472 Computer Graphics Vertex Normals Lighting is computed only at vertices A normal is associated with each vertex and indicates the surface orientation at that vertex . A polygon in the x/z plane: (0, 1, 0) A point (x,y,z) on a sphere centered on (0,0,0): (x,y,z) / |(x, y, z)|
Background image of page 2
3 CSE472 Computer Graphics OpenGL Rules You must normalize all vertex normals You can do glEnable(GL_NORMALIZE), but you take a big performance hit. Avoid this. Vertex normals (glNormal3d for example) are state. Must be set before glVertex is called Stays set afterwards Don’t call again if no change. ..
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 CSE472 Computer Graphics Example: A Cube // Front glBegin(GL_QUADS); glNormal3d(0, 0, 1); glVertex3dv(a); glVertex3dv(b); glVertex3dv(c); glVertex3dv(d); glEnd(); // Right glBegin(GL_QUADS); glNormal3d(1, 0, 0); glVertex3dv(c); glVertex3dv(b); glVertex3dv(f); glVertex3dv(g); glEnd(); a b c d e f g h
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/25/2008 for the course CSE 472 taught by Professor Owen during the Spring '08 term at Michigan State University.

Page1 / 28

lecture4 - CSE472 Computer Graphics Vertex normals, texture...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online