Living Museum of Learning

Where real moments become exhibits
← Prev Next →
The Green Sector That Exposed a Hidden Rule

The Green Sector That Exposed a Hidden Rule

When a brighter color revealed a hidden problem, Enning went hunting for numbers. A paintbrush eventually saved the day.

Situation

Enning had been building a pulley-wheel simulation with Donald. The wheel, its support, and an adjustable box were gradually becoming a small laboratory for exploring geometry and motion.

For homework, Enning added a second sector to her wheel and chose green to fill it. The purpose of the sectors was to make the wheel's rotation visible.

Her homework worked. She was satisfied.

But when the next class began, Donald immediately noticed something strange: the support appeared to cut through the wheel and its sectors.

“Watch carefully, Enning. Is there something different from your daily life experience?”

“Nothing wrong,” Enning replied.

Very Enning. 😂

Donald invited her to look more closely at the relationship between the support and the green sector. Eventually, she began to see the discrepancy.

The original sector had been dark blue. Its color had concealed the visual problem. The bright green sector made it obvious.

Turning Point

Enning started hunting for numbers in her code. Perhaps some coordinates needed adjusting. Perhaps a radius or an offset was wrong.

Donald suspected that her experience with 3D graphics in P5JS might be influencing her thinking, but he didn't jump to a conclusion.

Instead, he asked her to draw two arbitrary shapes in an empty region of the screen.

Enning drew a black triangle overlapping a blue one.

“Could you show the black one on top of the blue one?”

She began changing the x and y coordinates.

Donald almost fainted. 😂

Changing x and y could move the vertices left, right, up, or down. But how could she change which triangle appeared on top without moving either triangle?

Then Donald reached for an experience she already knew.

“Imagine you have a paintbrush. Stroke with a color. Then wash the brush, dip it in a different color, and stroke across the first mark. You don't have life experience? You've done this millions of times, right?”

“Oh, the order matters.”

The breakthrough had arrived.

Emergence

Enning finally drew the sectors before drawing the support.

The support now appeared in front of the wheel, as it should. The geometry had not needed to change. The positions of the vertices had not needed to change. The drawing procedure was what mattered.

Along the way, Enning even moved the physical locations of some function definitions in her source code. That was a separate issue she had encountered before and quickly understood, but it did not change the image on the screen in this experiment.

The green sector had done more than make rotation visible. It had exposed a hidden flaw, triggered an investigation, and led Enning to distinguish three different ideas: where objects are positioned, where functions are defined, and the order in which shapes are drawn.

A small color choice had opened a much bigger door.

Learning

A program can work as written while its visual result still conflicts with physical intuition.
Coordinates determine where vertices are positioned; changing them is not the same as changing the drawing order.
In ordinary 2D drawing, later opaque shapes cover earlier shapes where they overlap.
Function definitions, geometric coordinates, and drawing order are different aspects of a program. Understanding which one controls the observed behavior is part of debugging.
Everyday experience can help explain an abstract programming concept. Painting one stroke over another provided a bridge to understanding how overlapping shapes are rendered.
A visual change can reveal a problem that was already present. Enning's bright green sector did not create the flaw; it made the flaw easier to see.

Most importantly, debugging is not simply a hunt for numbers to change. It is an investigation into which rule produces the result.