## Modeling gravity for multiple objects

A former student, JH, recently corresponded with me about some simulations he'd done of a gravitational system. This problem is connected with many problems in physics including molecular dynamics and n-body problems. It is also of particular interest to game … Continue reading

## 4T 2015 Keynote: Learning to Code and Coding to Learn!

You can download my slides as a pdf or PowerPoint. Processing For many folks, Processing is something new. For illustration, here is a progression of easy sketches that give some of the flavor of Processing. drawSomething This sketch opens a … Continue reading

## Fractal trees with a gradient horizon

I introduced recursion to my students today using fractal trees as an example. They got to learn about using pushMatrix() and popMatrix() with the power of using rotate and translate to avoid nasty trig stuff. They asked about creating a … Continue reading

## Simulating collisions in two dimensions

We can study 2D collisions and the conservation of momentum via these Processing sketches. Colliding at right angles Colliding at any angle … Continue reading

## Generating a maze

I'm sure there are some great algorithms for generating mazes, but I rolled my own for the fun of it. Might be the basis for a game, or for generating a design for the laser cutter. The maze shown below … Continue reading

## Aliasing a drawing

When we look at an image on a display, we are actually looking at thousands of squares of light. This is different from what we see in the real world. The fact that we simulate details with small squares is … Continue reading

## Connect the dots

This is another in the vein of the rotating ellipses, lissajous figures, and other sketches I've written to generate graphical designs. Can you figure out how the program works just by studying its behavior? … Continue reading

A mask is an overlay that can be placed on top of an image, and partially blocks or blends with the background. For our purposes, think of the mask as an overlay on your screen, black in some areas, clear … Continue reading

## Artificial smoke

A physicist could come up with an elaborate model for simulating smoke that produces results indistinguishable from real smoke. We are interested in simple models, with successive refinement. Our first version of smoke introduces the idea of gradual fading by … Continue reading

## Paint Fill in Processing

Our class created a simple drawing program, and I suggested we add a paint fill capability. Why not select a color from a palette, and then if you click on an unpainted region, it fills the region with the selected … Continue reading

## Sleepy robots

To introduce a variety of programming topics in Processing, the class wrote a sketch of robots. We started with a single robot, learning about drawing with rect and ellipse, and using the translate to allow drawing a robot without having … Continue reading

## Rotating ellipses

Version 1 The spirograph could create miracles of graphical complexity. But you can get interesting patterns with just ellipses, rotated to create rotational symmetry. … Continue reading

## Breakout

Breakout is another example of one of the early big video games that can be built in Scratch. It has a colorful history: Steve Wosniak built the first version in four days, with Steve Jobs assembling breadboards and testing the … Continue reading