CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 CSE 872 Advanced Computer Graphics Charles B. Owen (Instructor) – 1138 E. B., MW 12:30-1:50pm in Kresge Art Center 041
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics2 Introduction Introduction to the class – Structure, rules, etc. Where do we stand? – What you should know coming in or get caught up on!
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics3 Course Content Basic and advanced modeling Scan conversion for photorealistic rendering Ray tracing and related methods Radiosity and hybrid methods Particle-based methods Physical modeling Water and fire Curves, splines, NURBS
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics4 Course Content Quaterians for computer graphics Computational geometry Non-photorealistic methods Volume rendering and constructive solid geometry Gaming and simulation Level of detail Augmented reality techniques
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics5 Course Content: Anything else? Real time using hardware – Pixel shaders Virtual reality Animation techniques Motion capture Post-production
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics6 Course Structure See the syllabus
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics7 Course Materials Textbooks – Advanced Animation and Rendering Techniques, Alan Watt, Mark Watt. ISBN: – OpenGL Programming Guide, Fifth Edition, Shreiner, Woo, Neider, and Davis, Addison Wesley, ISBN (Optional) WWW – – And on angel (angel.msu.edu)
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics8 Course Structure… Paper review/presentation Explorations Project 1 Project 2 Project 3 Class Participation
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics9 Where do we stand? What do we know about: – Configuring projection matrices – Configuring modelview matrices – Culling, depth testing – Lighting – Materials – What happens when you do glVertex?
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics10 void CChildView::OnGLDraw(CDC *pDC) { glClearColor(0.0f, 0.0f, 0.0f, 0.0f) ; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Set up the camera glMatrixMode(GL_PROJECTION); glLoadIdentity(); // Determine the screen size so we can determine the aspect ratio int width, height; GetSize(width, height); // Set the camera parameters gluPerspective(25., // Vertical field of view in degrees. GLdouble(width) / GLdouble(height), // The aspect ratio. 10., // Near clipping 200.); // Far clipping // Set the camera location glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(20., 10., 50., // eye x,y,z 0., 0., 0., // center x,y,z 0., 1., 0.); // Up direction
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics11 // Enable depth test glEnable(GL_DEPTH_TEST); // Cull backfacing polygons glCullFace(GL_BACK); glEnable(GL_CULL_FACE); // Enable lighting glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); GLfloat lightpos[] = {.5, 1, 1, 0.}; // GLfloat lightpos[] = {10., 10., 10., 1.}; glLightfv(GL_LIGHT0, GL_POSITION, lightpos);
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics12 glPushMatrix(); GLfloat white[] = {0.8f, 0.8f, 0.8f, 1.0f}; GLfloat cyan[] = {0.f,.8f,.8f, 1.f}; glMaterialfv(GL_FRONT, GL_DIFFUSE, cyan); glMaterialfv(GL_FRONT, GL_SPECULAR, white); GLfloat shininess[] = {100}; glMaterialfv(GL_FRONT, GL_SHININESS, shininess); glRotated(m_spinangle, 1,.5,.7); Box(5, 5, 5); glPopMatrix(); glFlush();
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics13 void CChildView::Box(GLdouble p_x, GLdouble p_y, GLdouble p_z) { GLdouble a[] = {0., 0., p_z}; GLdouble e[] = {0., 0., 0.}; GLdouble b[] = {p_x, 0., p_z}; GLdouble f[] = {p_x, 0., 0.}; GLdouble c[] = {p_x, p_y, p_z}; GLdouble g[] = {p_x, p_y, 0.}; GLdouble d[] = {0., p_y, p_z}; GLdouble h[] = {0., p_y, 0.}; // 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();