CSCE 441 Lecture 1

From Notes
Jump to navigation Jump to search

« previous | Monday, January 13, 2014 | next »


Midterm 3/3

Overview

  • 2D
    • lines, polygons
    • fractals
  • 3D
    • Transformations
    • Lighting
    • Ray Tracing
    • Solid Modeling
    • Splines/Subdivision

Assignments in C/C++

Graphics is mathematics made visible

Homework

Linear Algebra Test

Complete before January 27, 2014

Take as many times as you like

Must get at least 90% correct


Turn-in

  • Code
  • Visual Studio solution file
  • Visual Studio project file
  • Win32 Executable


OpenGL

#include <GL/gl.h>

int main()
{
    // make a window

    glClearColor(0.0, 0.0, 0.0, 0.0); // set clear color
    glClear(GL_COLOR_BUFFER_BIT); // clear screen
    glColor3f(1.0, 1.0, 1.0); // drawing color
    glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0); // set bounding box on screen
    glBegin(GL_POLYGON); // draw polygon; here are the vertices:
        glVertex3f(0.25, 0.25, 0.0);
        glVertex3f(0.75, 0.25, 0.0);
        glVertex3f(0.75, 0.75, 0.0);
        glVertex3f(0.25, 0.75, 0.0);
    glEnd();
    glFlush(); // make sure data goes to graphics card
}