Lecture 2: Graphics Pipeline Review

Graphics Pipeline Review

Graphics Pipeline

Object space: the coordinates stored in the mesh file, uploaded to the VBO, and sent to vertex shader as in vec3 vPosition

World space: M * vPosition

View space: V * M * vPosition

Clip space: P * V * M * vPosition

Normalized device coords: clip.xyz / clip.w

Window coords: gl_FragCoord

Matrix & Vector Review

Who can tell me what’s wrong with this code?

glm::mat4 model, view, projection;
glm::vec4 pos  = glm::vec4(1.1, 3.2, 9.7, 1.0);

glm::vec4 worldSpacePos = pos * model;