– VISUAL OBJECTIVE: A mountain landscape with a lake that starts at sunset and slowly gets dark as the sun goes down.
– LOGICAL BREAKDOWN::
Used a global variable to move the sun downwards.
Applied map() and constrain() to link the sun’s Y-position to color and opacity values
Background: Used lerpColor() to smoothly blend the sky from orange (day) to dark blue (night)
Combined circle() and rect() shapes for clouds. Layered triangle() shapes in varying shades of green for mountains to create depth
Used a rect() for the water and large ellipse() shapes for the earth
Night Overlay: Placed a full canvas black rect() at the very end of the draw() loop so it covers everything. Its transparency increases as the sun sets, creating the darkening effect
– AI USAGE: I used AI (Gemini) to understand better how to apply mathematical functions (like map() and constrain()) to my visual idea. I used it mainly to figure out how to link the sun’s position to the opacity of the night overlay.

Lascia un commento
Devi essere connesso per inviare un commento.