Day 3 · Thu May 28

Code as a brush

When you write a few lines of code, the model becomes a paintbrush you designed.

Day 3 makes computational thinking tangible without turning the workshop into a programming class. Students use ij8 chat to write and revise sketches, then learn the few ideas that make generative code feel controllable: coordinate space, parameters, randomness, and seeds. Same seed, same image; different seed, different image.

Schedule

  1. Block 1: instructor demo, class co-construction, student studio time
  2. Block 2: second lesson sequence or guided production sprint
  3. Break: 15 minutes away from the screen
  4. Block 3: studio work with instructor/tutor nudges
  5. Block 4: finish, export, document
  6. Daily share-back: every student shows one decision
  7. Reflection card and next-day preview

Lessons

Lesson 3.1 - Sketch fundamentals

Coordinate space, motion, randomness, and seeds.

I do / We do / You do

  • I do: 15 min: show a 30-line p5 sketch and change only the seed.
  • We do: 10 min: class asks the tutor to add one parameter and compares the sketch before and after.
  • You do: 25 min: each student starts from a sketch and asks for three controls.

Deliverable: One p5 sketch with three controls plus the seed it started from.

Stretch: Add a secondary palette that flips on a key press.

AI tutor aiGuidance excerpt

- nudge: Ask which parameter the student wants to control before asking for code.
- nudge: If the sketch breaks, compare the last working version to the new code.
- require: Do not create variables named scale, rotate, color, image, map, random, width, height, text, fill, stroke, or noise.

Starting code

let seed = 327;
let density = 12;
let palette = ['#0a0a0a', '#c01818', '#ffffff'];

function setup() {
  createCanvas(720, 720);
  noStroke();
}

function draw() {
  randomSeed(seed);
  background(palette[2]);
  for (let x = 40; x < width; x += width / density) {
    for (let y = 40; y < height; y += height / density) {
      let r = random(8, 32);
      fill(random(palette));
      circle(x + random(-12, 12), y + random(-12, 12), r);
    }
  }
}

Lesson 3.2 - Three dimensions or shaders

Go deeper into one creative-code paradigm.

I do / We do / You do

  • I do: 15 min: show a three.js rotating mesh and a GLSL fragment shader.
  • We do: 10 min: class picks one path and adds the first parameter together.
  • You do: 25 min: each student ships one three.js scene or one GLSL fragment shader.

Deliverable: One three.js scene with camera control or one GLSL fragment shader with two uniforms.

Stretch: Pair an audio channel using Tone.js, following the ij8 Tone.js guardrails.

AI tutor aiGuidance excerpt

- nudge: Ask the student to describe the behavior before requesting a library or technique.
- nudge: For Tone.js, keep pitches above laptop-speaker range and route through .toDestination().
- require: For event triggers, do not pass Tone.now() as the time argument; for scheduled repeats, use the callback time.

Starting code

// three.js starter: avoid variables named after p5 globals.
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(60, innerWidth / innerHeight, 0.1, 100);
const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setSize(innerWidth, innerHeight);
document.body.appendChild(renderer.domElement);
camera.position.z = 4;
const mesh = new THREE.Mesh(
  new THREE.IcosahedronGeometry(1, 2),
  new THREE.MeshNormalMaterial({ wireframe: false })
);
scene.add(mesh);
function animate(){
  mesh.rotation.x += 0.01;
  mesh.rotation.y += 0.013;
  renderer.render(scene, camera);
  requestAnimationFrame(animate);
}
animate();

How the tech works

In Day 3, the AI tutor is writing ordinary creative code: p5.js, three.js, GLSL, and optionally Tone.js. The important shift is that the student is no longer only describing an image; they are describing a system that can produce many images. Parameters become handles. A seed makes pseudo-randomness repeatable, so students can see determinism rather than just hear about it. The computational-thinking frame is deliberately organic: decomposition appears when a sketch is broken into background, shape, motion, and controls; abstraction appears when a number becomes a density slider; feedback loops appear when the tutor edits the code and the canvas changes. This follows the research recommendation to use CT routines as AI-literacy scaffolds without requiring a separate CS lecture. The tutor can generate syntax, but it cannot know what the student values in the sketch unless the student describes the system clearly. That makes code an unusually good medium for prompt literacy. Vague requests produce vague behavior; precise requests become testable changes. Students can ask for density, speed, palette, camera distance, or a boolean mode, then immediately see whether the code did what they meant. The canvas becomes evidence (NGLC computational thinking and AI literacy; Nature of Code).

A short history

Generative code has a long art lineage. Vera Molnár began algorithmic work in the late 1950s; Cybernetic Serendipity in 1968 made computer-generated art visible as an exhibition field; Manfred Mohr and Harold Cohen developed plotter and AI-assisted practices across decades. Processing, launched by Casey Reas and Ben Fry in 2001, made code-as-art accessible to many designers and students. Daniel Shiffman's Coding Train and Nature of Code extended that pedagogy into p5.js, while Tyler Hobbs' Fidenza made algorithmic variation newly visible to a broad collecting public. This lineage matters because it prevents students from treating AI-generated code as a shortcut around art history. The boot camp positions creative code as a studio tradition with its own masters, tools, communities, and debates. The model is a helper inside that tradition, not a replacement for choosing parameters, understanding variation, and making visual decisions. (Le Random history; The Coding Train).

Ethics for this day

Code raises authorship questions in a different way. If the tutor wrote the function but the student chose the system, parameters, seed, palette, and final revision, authorship is distributed. Students should still be honest: "AI-assisted p5.js sketch" is clearer than pretending every line was hand-written. Copyright and training-data debates around code models are live, just as image-data lawsuits are live. The point is not to settle ownership in 20 minutes, but to build a habit: keep prompts, explain decisions, and credit libraries or references. Day 3 also introduces a second integrity rule: if the AI tutor writes code that the student does not understand, the student should ask for a plain-language explanation before presenting it. Credit-bearing work does not require writing every line alone, but it does require being able to explain the system that was submitted.

Real-world applications

Famous works to study

What you should be able to do by the end of today

Deeper look

Optional note for the curious

Pseudo-randomness is not pure chaos. A generator starts from a seed, then produces a repeatable sequence that feels random. Artists use that contradiction constantly: they can explore variation while still returning to a chosen output.