## CS 455 Lecture 9 – Orthographic Projection

*February 24, 2015 by Chris Johnson. Filed under cs455, lectures, spring 2015.*

### Agenda

- what ?s
- mini review
- orthographic projection

### Mini Review

- What kind of shader data gets blended across the fragments/pixels of a triangle?
- What did we need to upload to the GPU to allow vertices to be shared across faces?
- What kind of shader data is defined per vertex?
- What operation tells us how aligned two vectors are?
- What kind of shader data is defined per draw call?
- What is the dot product of two unit-length vectors that point in opposite directions? Think about the cosine definition of the dot product.
- What happens if you try to transform a vector with a homogeneous coordinate of 0?

### TODO

As a lab exercise, add an orthographic projection into one of your renderers:

- Add a static
`GetOrthographic`

method to the `Matrix4`

class.
- Alter one of your renderers to expand the chunk of the world that is mapped to your window.
- Upload the orthographic projection matrix as a uniform to your vertex shader.
- Transform the vertex position now by two matrices:
`projection * xform * position`

. xform’s job is to position the object into the world, and projection’s job is to map the world into clip coordinates. Those objects whose clip coordinates are in [-1, 1] will appear in your window.
- Email me a screenshot of your larger world.

### Haiku

**on the scale effects of aging**

My world grows each year

More stuff, but same pixel count

My world shrinks each year

## Leave a Reply