...loading...
Canvas size:
Grid:
Creating an Eye Using Core Classes - Stage
...loading...
Canvas size:
Grid:
Eye 1 established the structure. Eye 2 asks a design question about
that structure: what happens when layers are visible through each other?
This stage explores SWDisk's alpha capability and deliberately
clears the visual clutter from Eye 1 to prepare the canvas for the
pupil layer arriving in Eye 3.
Big Picture — What This Stage Introduces
SWDisk — setFillAlpha()setFillAlpha(60) — 60% opaque, 40%
transparent. This makes the background color visibly bleed through the white fill,
proving that SWDisk respects the full HSB + alpha pipeline of
SWColor. It also previews a design decision: when a pupil disk is
drawn on top, can you still sense the sclera behind it? Alpha makes that possible.
swLightBlue.
This is a deliberate developer choice: a non-neutral background makes
transparency visible. If the sclera were opaque white on a white
background, setFillAlpha() would produce no perceptible effect.
The colored background turns alpha from an invisible property into a visible one.
shouldShowCenter = falseSWDisk center points were visible and labeled —
useful for placement debugging. Eye 2 turns them off. This isn't about the
center points being wrong; it's about readiness: the next stage will
place a pupil disk at a new offset center, and having two labeled
center dots would clutter the layered result. Hiding them now keeps the
visual story clean.
The Layering Mental Model
An eyeball is fundamentally a stack of disks, drawn back-to-front each frame. For that model to work, the layers need to interact predictably:
SWEyeball class uses a fully opaque sclera — but understanding how alpha interacts with layered disks is a prerequisite for building that class confidently.What to Notice in the Sketch
setFillAlpha() is working at the p5.js color level.(−2.5, 6) and (2.5, 6) compared to Eye 1, a quiet hint that spacing decisions are still being tuned.The Road Ahead
Eye 3 adds the pupil — a second SWDisk drawn on top of the sclera,
with its own independent SWPoint center. The semi-transparent sclera
from Eye 2 will make it easy to verify that the pupil disk is correctly positioned
over the sclera rather than behind it.