1 / 10

Computer Graphics (fall 2009)

Computer Graphics (fall 2009). School of Computer Science University of Seoul. OpenGL Program. How can we create a window? How can we handle the events? What kind of objects can we render? How can we define/describe/specify the objects? How can we specify the material/color of the objects?

hanh
Download Presentation

Computer Graphics (fall 2009)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer Graphics(fall 2009) School of Computer Science University of Seoul

  2. OpenGL Program • How can we create a window? • How can we handle the events? • What kind of objects can we render? • How can we define/describe/specify the objects? • How can we specify the material/color of the objects? • How can we transform the objects? • How can we set the camera? • How can we “map” what the camera sees onto the window?

  3. How can we create a window? • Using GLUT library functions • glutInit • Initialize GLUT • glutInitDisplayMode • Set framebuffer • glutInitWindowSize, glutInitWindowPosition and glutCreateWindow • Create a window

  4. How can we handle the events? • Using GLUT library • glut*Func() • Register event handler • Ex: glutDisplayFunc

  5. What kind of objects can we render? • Points • Lines, line strips, line loops • Triangles, quadrilaterals, polygons • Triangle strips, triangle fans, quad strips • Simple & convex polygons only • More complex objects supported by GLU & GLUT

  6. How can we define / describe / specify the objects? • glBegin(…) ~ glEnd() • Specify vertices using glVertex*()

  7. How can we specify the material/color of the objects? • glMaterial*() • glColor*() • Indexed color • Current states

  8. How can we transform the objects? • Specify the transformations as 4x4 matrices (affine transformations) • Current state • Kept in the “Modelview” matrix stack • Hierarchical transformation supported • Special functions for transformations: glTranslate*(), glRotate*(), glScale*()

  9. How can we set the camera? • Represented as a 4x4 matrix • Current state • Kept in the “projection” matrix stack • Special functions: glOrtho*(), glFrustum() • More functions in GLU (ex: gluPerspective)

  10. How can we “map” what the camera sees onto the window? • glViewport() • Aspect ratio

More Related