Plan for today
- Review math questions
- Geometry
- Look ahead to next homework: a creative scene or object
- unprojection
- Next time: Material and Lighting
Documentation
How can you position your model in your scene? What is its bounding
box? What is its reference point (origin)? How can you determine those?
Great Documentation that makes it easy for others to use the
functions you defined. Think about how you might define your creative
object. Documentation should probably include:
- origin
- orientation
- size
- colors
- other info?
- and maybe an example of usage. Minimum and maximum argument
values, if any. Warnings and pre-conditions.
Geometry
Use some of the code in TW.py to do the
math.
- vector dot product. Let's do some examples. We can use twDot()
- angle cosines. We can use twRadiansToDegrees().
- cross product. See twCrossProduct()
- why are we doing this?
- Consider the TW camera positioning code
Unprojection Demos
The key thing to know is that projection maps points to Normalized
Device Coordinates (NDC), which is [-1,+1] on X and Y and [0,1] on Z,
with 0 being the near plane and 1 being the far plane.
The pytw/TW.py routines
are twProject and twUnProject.
Next time, Material and Lighting
- Ambient, Diffuse and Specular
- types of material
- types of lights
- OpenGL calls
- use the tutors!
- Challenge: when would we need the additional power of the OpenGL
material API over the simplified TW material API?
Written by Scott D. Anderson
scott.anderson@acm.org

This work is licensed under a Creative Commons
License.