The 3D Bike Pedal Queen
Situation
Yesterday, Enning had built a static bicycle bar and pedal in p5.js.
Today, Donald gave her a deliberately smaller task:
Make the bar rotate first. Don't touch the pedal yet.
It sounded simple.
It wasn't.
Turning Point
Enning got the blue bar rotating, but it initially rotated around its middle point.
With some help, she made it rotate like the hand of a clock.
Then came the pedal.
Getting the pedal to follow the rotating bar wasn't particularly difficult. Soon Enning happily announced:
“Done!”
Donald asked:
“Now comes the real thing. Does it look correct?”
Enning didn't see a problem.
So Donald asked her to think about a real bicycle: when we put our feet on the pedals, the bottoms of our feet stay parallel to the ground.
Enning immediately went back to her whiteboard drawing from the previous day.
There it was.
She had already drawn each pedal horizontally at every position around the circle.
Her own drawing told her that the animation was wrong.
Enning's pair of pedals:
Emergence
The pedal needed to travel with the bar, but it should not rotate with the bar.
Enning reasoned through the problem with Donald.
One possibility was to give the pedal an opposite rotation to cancel the rotation it inherited from the bar.
They moved the pedal back to the origin and made it rotate counterclockwise.
Now two objects were visibly rotating in opposite directions.
Then came the next challenge:
How do we put the pedal back in its real position without destroying the rotation we just created?
This turned into a surprisingly tricky exercise.
The order of translate() and rotateZ() mattered.
The grouping of the bar and pedal mattered.
What was inside a push() / pop() block mattered.
Donald and Enning struggled with the transformations together for a while.
Then—
it worked.
For the first few seconds, Enning didn't believe it.
She still thought something must be wrong.
But it wasn't.
The pedal was traveling around with the rotating bar while keeping the orientation required by the physical bicycle.
The hardest part was done.
Learning Through the Second Half
The bicycle still needed the other half.
Donald handed the job to Enning:
“Now it's your job to put the other half into the picture.”
She started with much more confidence.
It wasn't easy.
The two bars initially stayed together instead of separating to opposite sides. She had to think about whether to rotate the new half by 180 degrees or translate it to the other side.
The location of the new pedal followed from the same geometric reasoning.
And this time, she got the complete pair working without the long struggle required for the first half.
That difference mattered.
The first half had given her the idea.
The second half gave her a chance to use the idea herself.
One More Thing
Near the end of the class, Donald remembered something Enning had shouted while building her bicycle seat:
“It has to be smaller!”
The finished pedal mechanism works, but it isn't ready to mount on the rest of the bicycle yet.
It needs another capability:
easy control of its size.
Donald told her:
“We do need to control its size. But that belongs to our other classes.”
And so the project remains deliberately unfinished.
Not because the work failed.
Because the next problem has already appeared.
Learning
Enning's bicycle pedals became a small laboratory for 3D programming.
She encountered:
coordinates and axes;
rotation and translation;
pivot points;
relative orientation;
transformation order;
hierarchical grouping;
debugging by looking at the physical result;
and transferring an idea from one half of a mechanism to the other.
Most importantly, she learned to ask a question that is much more important than:
“Does the code run?”
She learned to ask:
“Does it look correct?”
The real bicycle became the specification.
Her whiteboard drawing became evidence.
The computer became an experimental laboratory.
And mathematics quietly became part of the mechanism.
Theme
Build it. Make it move. Look carefully. Then make the virtual object behave like the real one.
Enning didn't need an extraordinary talent for this.
She needed to stay with the problem long enough for the geometry to reveal itself.
And once the first difficult half finally worked, she discovered something even more valuable:
She could build the second half herself.
What Is Possible
A few cylinders, boxes, coordinates, and transformations can become a working bicycle-pedal mechanism.
How Does It Happen
By turning a physical requirement into geometric constraints, experimenting with transformations, and using the visual result to guide the next step.
Why Does It Matter
Because mathematics and programming become much more powerful when they are used to make something real enough to question: Does it actually behave the way it should?