CS 455 Lecture 7 – Diffuse Lighting and Rotational Power
Before Class
Dot Product and Diffuse
- Watch http://youtu.be/WUU_l1IX2As.
- Watch http://youtu.be/MBSvCUWdOhU.
- For some other perspectives, read http://ogldev.atspace.co.uk/www/tutorial18/tutorial18.html (stopping at Code Walkthrough) and http://en.wikibooks.org/wiki/Cg_Programming/Unity/Diffuse_Reflection (stopping at Shader Code for One Directional Light Source).
Accumulating Transformations and Rotation++
In Class
- Implement a renderer that lets you spin a shaded cylinder (in cylinder.obj in W455). The cylinder is aligned with the Y axis and has a radius of 0.5. Like a sphere, its normals are derivable from its vertex positions. Think with your partner how they might be calculated, but call upon me if the answer doesn’t well up in your brain after a minute of thinking.
- If you have time, make your light source move. Here’s where you can make the sun orbit Earth.
Haiku
Darkness is scary
Not because of what it is
It’s that there’s no light
Not because of what it is
It’s that there’s no light