CPSC 424, Fall 2013
Information About the First Test

The first test will be given in class on Monday, September 30. The test will cover Section 0 through the first half of Section 9 of the notes. From Section 9, it will only cover normal vectors and the basic ideas of lighting. The test will also cover Labs 1 through 5.

Some things not on the test: using class Path2D to draw with Java; writing HTML or CSS; working with checkboxes and popup menus in JavaScript; GLUT event handling, such as glutKeyboardFunc(f); programming in C aside from writing basic OpenGL code; setting up JOGL; matrices; homogeneous coordinates.

The format of the test will be the usual: some essay questions and definitions; reading some code and explaining its purpose; writing some code. There will probably be some geometrical questions that ask you to work with transformations and primitives. I might give you some code and ask you what it draws. I might give you a picture and ask how it could be drawn. There will be less actual coding than on most of my tests.


Here are some terms and ideas that you should be familiar with:

computer graphics
pixels
painting programs vs. drawing programs

Basic elements of 3D Graphics:
    geometric modeling                   lighting and material
    geometric transformations            textures 
    viewing and projection               animation
   
2D graphics with Java Graphics2D
    AffineTransforms in Graphics2D:
         g.scale(a,b);
         g.rotate(angle);    // angle in radians
         g.translate(dx,dy);
         g.shear(a,b);
         AffineTransform transform = g.getTransform()
         g.setTransform(transform);
    Shape classes that use real numbers
         Line2D, Line2D.Float, Line2.Double
         Rectangle2D, Rectangle2D.Float, Rectangle2D.Double
         Ellipse2D, Ellipse2D.Float, Ellipse2D.Double
         g.fill(shape)
         g.draw(shape)
    All the old Java graphics stuff, like g.setColor, g.drawLine, g.fillRect, ...
    
aspect ratio
antialiasing
modeling transformation
combining transformations 
     (applied to an object in the opposite order to their order in the code)
bezier curves; control points for bezier curves
hierarchical modeling
using subroutines to implement hierarchical modeling
scene graphs
traversing a scene graph
how a stack of transformations is used while traversing a scene graph

Basic JavaScript programming:
    variables are untyped
    using  var  to declare variables
    writing subroutines using the syntax:  function name(params) { ... }
    JavaScript arrays
    JavaScript objects
    things that are essentially like Java (assignment, if, for, while, try)

HTML canvas graphics:
    the properties graphics.lineWidth, graphics.fillStyle, and graphics.strokeStyle
    graphics.scale(a,b);                  
    graphics.rotate(angle);                graphics.beginPath();
    graphics.translate(dx,dy);             graphics.moveTo(x,y);    
    graphics.save();                       graphics.lineTo(x,y);  
    graphics.restore();                    graphics.arc(x,y,radius,startAngle,endAngle);   
    graphics.fillRect(x,y,w,h);            graphics.fill();       
    graphics.strokeRect(x,y,w,h);          graphics.stroke();        

3D graphics
3D coordinate systems and the z-axis
the standard OpenGL coordinate system
right-handed coordinate system
hidden surface problem
painter's algorithm
depth test and the depth buffer
rotation in 3D; the axis of rotation
the right-hand rule for direction of rotation in 3D
object coordinates
world coordinates
eye coordinates
clip coordinates
device coordinates
the modelview transformation; relationship between modeling and viewing transforms
using glPushMatrix/glPopMatrix to implement hierarchical graphics in OpenGL
projection transform
orthographic projection
perspective projection
the view volume
the depth test requires a finite view volume
lighting and materials
the difference between "color" and "material" in OpenGL
vectors
length of a vector
unit vector
dot product of two vectors
normal vectors
how normal vectors are used for lighting
diffuse reflection and specular reflection

the OpenGL primitives:
    GL_POINTS                   GL_TRIANGLES
    GL_LINES                    GL_TRIANGLE_FAN
    GL_LINE_LOOP                GL_TRIANGLE_STRIP
    GL_LINE_STRIP            

OpenGL 1.0 functions that you should understand and be able to use:
    glClearColor(r,g,b,a)
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
    glBegin(primitive)  and  glEnd()
    glVertex3f(x,y,z), glVertex2f(x,y), etc
    glColor3f(x,y,z)
    glNormal3f(x,y,z)
    glTranslatef(dx,dy,dz)
    glScalef(a,b,c)
    glRotatef(angle, axisX, axisY, axisZ)  // angle in degrees
    glPushMatrix()
    glPopMatrix()
    glMatrixMode(GL_PROJECTION) and glMatrixMode(GL_MODELVIEW)
    glLoadIdentity()
    glFrustum(left,right,bottom,top,near,far)
    glOrtho(left,right,bottom,top,near,far)
    glEnable(GL_DEPTH_TEST)
    glEnable(GL_LIGHTING)
    glEnable(GL_LIGHT0)
    glEnable(GL_COLOR_MATERIAL)
    glEnable(GL_NORMALIZE)
        
GLUT and GLU functions that you should understand and be able to use
    gluLookAt( eyex,eyey,eyez, refx,refy,refz, upx,upy,upz )
    glutSolidCube(size)
    glutSolidSphere(radius,slices,stacks)
    glutSolidCylinder(radius,height,slices,stacks)
    glutSolidCone(radius,height,slices,stacks)