CS 455 Lecture 14 – Perspective
March 19, 2015 by Chris Johnson. Filed under
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378
Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379
Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380
Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381
Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382
Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378
Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379
Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380
Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381
Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382
Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378
Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379
Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380
Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381
Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382
Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
cs455, lectures, spring 2015.
Agenda
- what ?s
- the limits of orthographic
- perspective matrix derivation
TODO
- As a lab exercise, alter one of your renderers to use a perspective projection. (Add a GetPerspective method to Matrix4). In orthographic projections, which don’t really have a physically realistic concept of an eye, we can put the image plane wherever we want, even behind or on the eye. This means our models can also be placed pretty much anywhere. However, with perspective projections, we need the near plane to be away from the eye/origin, and our models must be moved beyond the near plane in order to project onto it. However, we still we want to be able to rotate the model around its own center using our trackball interface. So, we want the model to stay around the origin while we rotate, but then we need to push it away from the origin. We can support both perspective and trackball rotation in the following manner:
shader_program->SetUniform("xform", Matrix4::GetTranslate4(Vector4(0, 0, -push_from_origin, 0)) * trackball_rotation);
shader_program->SetUniform("projection", Matrix4::GetPerspective(l, r, b, t, n, f));
// draw
Haiku
on courting in three dimensions
You think I’m too short
I think you’re too far away
Nearer, I’m dearer