From c9ec19c3cd15ed666138b11cd12c9efc036cb3b9 Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Thu, 24 Jun 2021 16:43:12 -0700 Subject: [PATCH] eoc2: update with initial values from the book. --- rtchallenge/examples/eoc2.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/rtchallenge/examples/eoc2.rs b/rtchallenge/examples/eoc2.rs index 885af1f..a40b12f 100644 --- a/rtchallenge/examples/eoc2.rs +++ b/rtchallenge/examples/eoc2.rs @@ -35,14 +35,12 @@ fn draw_dot(c: &mut Canvas, x: usize, y: usize) { c.set(x + 1, y + 1, red); } fn main() -> Result<()> { - let mut p = Projectile { - position: point(0., 1., 0.), - velocity: 10. * vector(1., 2., 0.).normalize(), - }; - let e = Environment { - gravity: vector(0., -0.1, 0.), - wind: vector(-0.01, 0., 0.), - }; + let position = point(0., 1., 0.); + let velocity = vector(1., 1.8, 0.).normalize() * 11.25; + let mut p = Projectile { position, velocity }; + let gravity = vector(0., -0.1, 0.); + let wind = vector(-0.01, 0., 0.); + let e = Environment { gravity, wind }; let w = 800; let h = 600;