🎬 Stage 5: Title Blur & Acceleration (Final Version)

Experimental journey from Stage 4 β†’ 4a β†’ 4b β†’ Stage 5

movieCreditsSim5.html

πŸ“‹ Stage 5 Overview

Stage 5 represents the culmination of experimentation with title exit effects. This version combines:

✨ Result: A dramatic, cinematic title sequence where the title zooms toward the viewer, then blurs, fades, and accelerates as it "flies past" the camera. Student credits then appear after the title exits.

πŸ‘€ User Request #9 - Stage 4a: Title Blur Experiment

Context: After seeing the title animation in Stage 4, user wanted to enhance the exit effect

Observation: "Student names blur and fade as they exit. As the title gets larger, can we make it likewise blur and fade as it leaves?"

Questions:

Strategy: Create experimental version (4a) to test before committing to changes

πŸ€– Implementation - Stage 4a Variables

Added new configuration variables to control title blur/fade effect:

// *** TITLE FINAL SIZE *** // EXPERIMENTAL: Increased to 400 (was 200) so title gets huge as it exits const TITLE_FINAL_SIZE = 400; // *** TITLE BLUR START SIZE *** // EXPERIMENTAL: When title reaches this size, blur/fade effect begins // This creates dramatic exit effect similar to credit names const TITLE_BLUR_START_SIZE = 250;
πŸ§ͺ Experimental Rationale:
  • TITLE_FINAL_SIZE = 400: Doubling from 200 to 400 makes title fill screen before exit
  • TITLE_BLUR_START_SIZE = 250: Blur begins at 62.5% of journey (250/400)
  • Goal: Test if blur looks good on expanding text (opposite of shrinking credits)

πŸ€– Implementation - Stage 4a: Fade Logic

Modified updateMovieTitle() to fade title as it approaches final size:

function updateMovieTitle(title) { // ... existing growth code ... // *** EXPERIMENTAL: Fade title as it approaches final size *** if (title.size >= TITLE_BLUR_START_SIZE) { // Calculate how far into the blur phase we are (0 to 1) let blurProgress = (title.size - TITLE_BLUR_START_SIZE) / (TITLE_FINAL_SIZE - TITLE_BLUR_START_SIZE); // Fade from 100 to 0 as we approach final size title.opacity = 100 * (1 - blurProgress); } }
πŸ“š Teaching Point - Fade Math:

Progress calculation example:

  • At size 250: blurProgress = (250-250)/(400-250) = 0/150 = 0 β†’ opacity = 100
  • At size 325: blurProgress = (325-250)/(400-250) = 75/150 = 0.5 β†’ opacity = 50
  • At size 400: blurProgress = (400-250)/(400-250) = 150/150 = 1 β†’ opacity = 0

Key insight: Same progress normalization technique, but applied to opacity instead of tilt!

πŸ€– Implementation - Stage 4a: Blur Rendering

Created blur effect functions for title (similar to credit blur):

function displayMovieTitle(title) { if (title.active && title.opacity > 0) { // Apply blur effect when title gets large let shouldBlur = title.size >= TITLE_BLUR_START_SIZE; if (shouldBlur) { drawBlurredTitle(title); } else { drawNormalTitle(title); } } } function drawBlurredTitle(title) { push(); translate(title.x, title.y); rotate(radians(title.tiltAngle)); textSize(title.size); // Draw multiple blur layers with scaled spread for (let i = 0; i < BLUR_STRENGTH; i++) { let layerOpacity = title.opacity / BLUR_STRENGTH; fill(title.hue, 80, 100, layerOpacity); // Scale spread with title size (bigger = more spread) let spreadMultiplier = title.size / 100; let offsetX = randomGaussian(0, BLUR_SPREAD * spreadMultiplier); let offsetY = randomGaussian(0, BLUR_SPREAD * spreadMultiplier); text(title.text, offsetX, offsetY); } pop(); }
πŸ§ͺ Key Experiment - Scaled Blur Spread:

Problem: Fixed blur spread looks tiny on large text (400px), huge on small text (50px)

Solution: spreadMultiplier = title.size / 100

  • At 100px size: multiplier = 1.0 β†’ spread = 8 Γ— 1.0 = 8px
  • At 250px size: multiplier = 2.5 β†’ spread = 8 Γ— 2.5 = 20px
  • At 400px size: multiplier = 4.0 β†’ spread = 8 Γ— 4.0 = 32px

Result: Blur proportional to text size - looks consistent throughout animation!

πŸ‘€ User Feedback on 4a

"It looks better than I thought it might"

βœ… Blur effect on expanding title works well!

βœ… Larger final size (400px) creates dramatic exit

βœ… Fade timing feels natural

πŸ‘€ User Request #10 - Stage 4b: Acceleration Boost

New Idea: "As it starts to blur and jiggle, can we give it a boost to speed it up out of view?"

Rationale: When blur begins, title should feel like it's accelerating past the viewer

Goal: Add speed increase when blur phase starts

Safety: "Let's do that in a version 4b just in case things get wonky"

πŸ€– Implementation - Stage 4b: Acceleration Variable

Added new growth rate for the blur phase:

// *** TITLE GROWTH RATE *** // How quickly the title grows each frame (normal speed) const TITLE_GROWTH_RATE = 1.5; // *** TITLE ACCELERATED GROWTH RATE *** // NEW: How quickly title grows when blur effect starts // This "boost" makes title zoom out faster during blur/fade const TITLE_ACCELERATED_GROWTH = 4.0;
πŸ§ͺ Acceleration Design:
  • Normal rate = 1.5: Slow, steady zoom (8px β†’ 250px)
  • Accelerated rate = 4.0: Fast exit (250px β†’ 400px)
  • Ratio: 4.0 Γ· 1.5 = 2.67Γ— faster during blur
  • Frames to exit: (400-250)/4.0 = 37.5 frames β‰ˆ 0.6 seconds at 60fps

πŸ€– Implementation - Stage 4b: Dynamic Speed Switching

Modified updateMovieTitle() to switch between growth rates:

function updateMovieTitle(title) { // *** Choose growth rate based on whether we're in blur phase *** let currentGrowthRate = TITLE_GROWTH_RATE; if (title.size >= TITLE_BLUR_START_SIZE) { // Switch to accelerated growth when blur starts currentGrowthRate = TITLE_ACCELERATED_GROWTH; } // Grow the title using current rate if (title.size < TITLE_FINAL_SIZE) { title.size += currentGrowthRate; } else { title.active = false; title.opacity = 0; } // ... fade and straightening logic ... }
πŸ“š Teaching Point - Conditional Speed:

Animation Timeline:

  1. Phase 1 (size 8 β†’ 250): Normal growth at 1.5 px/frame
  2. Transition (size = 250): Blur starts, speed switches
  3. Phase 2 (size 250 β†’ 400): Accelerated growth at 4.0 px/frame

Simultaneous effects at size 250:

  • βœ… Blur rendering activates
  • βœ… Fade begins (opacity starts decreasing)
  • βœ… Speed boost kicks in (growth rate increases)

Result: Creates illusion of sudden acceleration - like title is "launched" toward viewer!

πŸ€– Stage 4b: Physics & Real-World Connection

πŸ“š Physics Lesson - Acceleration:

What is acceleration?

  • Definition: Change in velocity over time
  • Formula: acceleration = Ξ”velocity / Ξ”time
  • Units: pixels per frame per frame (or m/sΒ² in real physics)

In our animation:

  • Before: velocity = 1.5 px/frame (constant)
  • At trigger: velocity jumps to 4.0 px/frame
  • Change: Ξ”v = 4.0 - 1.5 = 2.5 px/frame
  • Time: Change happens in 1 frame (instant boost)
  • Acceleration: 2.5 px/frameΒ² (very high!)

Real-world examples:

  • πŸš— Car accelerating from stop: gradual speed increase
  • πŸš€ Rocket launch: continuous acceleration fighting gravity
  • 🎒 Roller coaster: acceleration + deceleration creates thrills
  • ⚑ Our title: instant "boost" like a turbo button!

Extension challenge:

Instead of instant speed change, could we gradually accelerate?

// Gradual acceleration example:
if (title.size >= TITLE_BLUR_START_SIZE) {
  currentGrowthRate += 0.1; // Add 0.1 each frame
  currentGrowthRate = min(currentGrowthRate, 4.0); // Cap at max
}

This would create smoother, more realistic acceleration!

πŸ‘€ User Feedback on 4b

"This is very good!"

βœ… Acceleration boost creates dramatic exit effect

βœ… Combined blur + fade + acceleration works together beautifully

βœ… Timing feels cinematic and polished

Decision: "Let's make a copy as movieCreditsSim5.html"

⭐ Stage 5: Final Configuration

Version 5 includes all successful experiments from 4a and 4b:

// Movie Title Configuration (from Stage 4a & 4b) const MOVIE_TITLE = "Learning CS\nwith AI"; // Multi-line title const TITLE_INITIAL_SIZE = 8; // Tiny start const TITLE_FINAL_SIZE = 400; // Huge exit (from 4a) const TITLE_GROWTH_RATE = 1.5; // Normal speed const TITLE_ACCELERATED_GROWTH = 4.0; // Boost speed (from 4b) const TITLE_DURATION_MS = 3000; // 3 second sequence const TITLE_BLUR_START_SIZE = 250; // When effects begin (from 4a)
✨ Stage 5 Complete Animation Sequence:
  1. 0ms - Title appears: 8px, tilted, centered, cyan color
  2. 0-167 frames (0-2.8s): Title grows 8px β†’ 250px at 1.5 px/frame, slowly straightening
  3. Frame 167 (size=250px): Blur/fade/acceleration ALL activate simultaneously
  4. 167-205 frames (2.8-3.4s): Title zooms 250px β†’ 400px at 4.0 px/frame while blurring and fading
  5. ~3400ms - Title exits: Opacity reaches 0, title.active = false
  6. 3000ms - Credits begin: First student name starts appearing

πŸ“Š Stage 5: Complete Feature List

From Previous Stages:

New in Stage 5 (from experiments 4a & 4b):

Key Variables Added:

Key Functions Modified:

πŸŽ“ Learning Outcomes: Stage 4a β†’ 4b β†’ 5

πŸ“š Software Development Process:

What students learned about development workflow:

  1. Experimentation: Test risky changes in separate versions (4a, 4b)
  2. Iteration: Build on what works, discard what doesn't
  3. User Feedback: "It looks better than I thought" β†’ keep feature
  4. Incremental Enhancement: Add one feature at a time, test, refine
  5. Version Control: Numbered versions track evolution (4 β†’ 4a β†’ 4b β†’ 5)

Programming Concepts Practiced:

  • Conditional Logic: if (size >= threshold) switch behavior
  • Progress Normalization: Converting values to 0-1 range for calculations
  • Proportional Scaling: spreadMultiplier makes effects consistent
  • State Management: Tracking when to trigger different effects
  • Parameter Tuning: Adjusting values for desired visual effect

Mathematics Applied:

  • Linear interpolation: opacity fade from 100 to 0
  • Progress calculation: (current - min) / (max - min)
  • Proportional scaling: spread Γ— (size / 100)
  • Rate of change: acceleration = change in velocity
  • Threshold detection: trigger effects at specific values

Design Principles:

  • Simultaneous effects create impact (blur + fade + acceleration together)
  • Proportional scaling maintains visual consistency
  • Threshold-based transitions feel natural
  • Acceleration creates excitement and energy
  • Configuration variables enable easy experimentation

βœ… Stage 5 Complete!

🎬 What Makes Stage 5 Special:

Cinematic Quality:

The title sequence now rivals professional movie titles with its combination of:

  • Dramatic zoom (8px β†’ 400px = 50Γ— size increase!)
  • Dynamic blur effects that scale with text size
  • Coordinated fade-out during exit
  • Acceleration boost creating sense of speed
  • Smooth straightening throughout

Educational Value:

Students experienced authentic software development:

  • βœ… Proposed idea: "Can we blur the expanding title?"
  • βœ… Tested hypothesis: Created version 4a
  • βœ… Evaluated result: "Looks better than I thought"
  • βœ… Enhanced further: Added acceleration in 4b
  • βœ… Finalized: "This is very good!" β†’ Version 5

Technical Achievement:

Multiple coordinated animations triggered by single threshold:

if (title.size >= TITLE_BLUR_START_SIZE) {
  // Blur: activate multi-layer rendering
  // Fade: opacity decreases with progress
  // Acceleration: growth rate increases
}

Files Created:

  • movieCreditsSim4a.html - Experimental blur/fade version
  • movieCreditsSim4b.html - Experimental acceleration version
  • movieCreditsSim5.html - Final polished version ⭐
  • chatLog5.html - This documentation

πŸŽ‰ Stage 5 represents the pinnacle of our title animation - combining physics, math, and design into a dramatic cinematic experience!

πŸš€ What's Next?

Possible Future Enhancements:

Student Challenges:

  1. Change TITLE_ACCELERATED_GROWTH to 6.0 - what happens?
  2. Set TITLE_BLUR_START_SIZE to 150 - does blur start too early?
  3. Try TITLE_FINAL_SIZE = 600 - does title get too big?
  4. Modify spreadMultiplier to title.size / 50 - how does blur change?
  5. Add a second title after credits (like "End Credits")

The power of configuration variables: Change one number, see dramatic effects!