Lecture 1 - Syllabus and Starting Graphics
Introductions
The big sections we'll cover are:
The difficulty of the class is like this:
So keep that in mind.
We'll cover:
- Fundamentals of Comp. Graphics
- The Graphics Pipeline (SW and HW)
- How to represent models
- How to transform these models
- How to light these models
- Applied Linear Algebra (yay!)
- Libraries:
- OpenGL, glfw, and GLSL
We'll have:
- Programming: C++, opportunity to practice using many libraries and translating math into code
- Need to be comfortable with HS math and Linear Algebra
You'll need to make graphics programs are going to be system dependent. That's just because graphics is super system dependent. We'll use:
cmake
w/ vscode
Structure of the Course
- Group Lecture Activities
- NO Computers (Imma ask her lel)
Expectations
- No code snobs
- Prioritize the education of others. Explain our own thinking to others and help them out :)
There's:
- Quizzes (every 1-2 weeks). Really practice for the MTs
- 2 MTs
- 4-5 medium programming assignments
- 1 software rasterizer + 4 OpenGL applications
- One larger final project
- Labs: smaller exercises
- Participation (both in lecture and in lab and in office hours)
- Labs are all demoed.
Texts:
- Foundations in Computer Graphics by Steven Gortler
- Fundamentals of Computer Graphics by Peter Shirley
- LearnopenGL.com
Let's Start!
Goal: Make a computer to draw. Simple enough.
We did an activity where one person tried describing a pokemon to someone else, who needed to draw it. We drew the following:
In a similar way, we have the goals in CG of:
- Simulate real world digitally
- Enhance real world digtally
Really, all you do as a programmer is put a color on a pixel, but the whole point is that the visual cortex is a huge part of how we percieve the world, so we have a lot of influence.
Ok, so how do we get computers to draw? Think data first. We get an 'obj' file like the following:
v 0 0 0
v 1 0 0
v 1 0 1
v 0 0 1
v 0.5 1.0 0.5
...
These are called index faced sets. It describes the vertices of our 3D image:
Then what follows in the file is a list of faces that give the 3 vertices that compose the face:
f 1 3 4
f 1 2 3
f 4 3 5
f 2 5 3
...
We get a total file like below:
v 0 0 0
v 1 0 0
v 1 0 1
v 0 0 1
v 0.5 1.0 0.5
f 1 3 4
f 1 2 3
f 4 3 5
f 2 5 3
So, for instance, the image in Lecture 1 - Syllabus and Starting Graphics 2024-01-09 13.51.33.excalidraw we have:
v 1 2 1
v 3 1 0
v 1 0 2
f 1 2 3
First Lab
We'll take these .obj
files to try to draw various triangles. First, we have to try to draw a single triangle on some window. You'll want to be given pixel locations (ex: (115, 170) draw a green, ...). You'll need to draw the bounding box of the rectangle that contains all 3 vertices: