nannou-org / nannou

A Creative Coding Framework for Rust.
https://nannou.cc/
6.05k stars 306 forks source link

Nature Of Code example 1.10 is not working. #890

Open platlas opened 2 years ago

platlas commented 2 years ago

Mover element is not showing up. It seems like acceleration of Mover is 'polluted' by NaN coordinates when initial mouse event is not triggered.

https://github.com/nannou-org/nannou/blob/874441235377b0675f7ee862c50a714ba5a65d2f/nature_of_code/chp_01_vectors/1_10_motion101_acceleration.rs#L41

If I change normalize() to normalize_or_zero() then Mover element is drawn at initial position and waits for mouse event.