summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-07-31 08:43:21 -0700
committerEric Anholt <eric@anholt.net>2009-07-31 08:57:43 -0700
commit1b89c71b07ad649c640ad9e8bbbce6074b122d39 (patch)
treeb430c8702895b0468a219a8a818a61b5ef5ed1f7
parenta69472bfe2ac7b78ee1273d78729b56b37be26b7 (diff)
Use new gluFrustum6 to do a better job of coming up with the projection.
-rw-r--r--shadow_map.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/shadow_map.c b/shadow_map.c
index a0df0ee..79e3fd4 100644
--- a/shadow_map.c
+++ b/shadow_map.c
@@ -80,9 +80,12 @@ calculate_light_projection(void)
&light_world,
&ring_bounding_sphere_center_world,
&light_up);
- gluPerspective4(&temp, 120, /*XXX: calculate me */
- 1.0, /* we're using a bounding sphere, w == h */
- 0.2, 40);
+ gluFrustum6(&temp,
+ -ring_bounding_sphere_radius, ring_bounding_sphere_radius,
+ -ring_bounding_sphere_radius, ring_bounding_sphere_radius,
+ light_distance_to_rings - ring_bounding_sphere_radius,
+ light_distance_to_rings + ring_bounding_sphere_radius);
+ print_GLUmat4("frustum", &temp);
gluMult4m_4m(&world_to_light_ndc, &temp, &world_to_light_eye);
}