3D Web · Exercise 4 of 4 Previous
Advanced
A glow that respects motion
The overlay (already written) draws the rear light's glow every frame. Write its two rules from Topic 14.6.
glowBrightness(time, moving): a steady 0.8 when moving is false; otherwise a pulse between 0.3 and 1 at 1.5 per second. facingFade(dot): 0 at −0.5 or below, 1 at 0.3 or above, a smooth step between.
What Check tests
- Steady 0.8 when motion is off
- While moving it pulses between 0.3 and 1
- No more than 3 pulses per second (WCAG 2.3.1)
- facingFade: 0 from the front, 1 from behind, smooth between
- The overlay draws every frame
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.