Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu Outline • • • • • About Alice Some Lessons Learned Advanced Functionality Building An Alice World Building Virtual Worlds: the class The Problem • • • • 3D faster than Moore’s Law 3D authoring is too hard “What If” too expensive Current 3D APIs – Non-intuitive behavior – Implementation leaks through What Alice Is... • Allows novices to write scripts that control interactive 3D graphics • Novices – 19 year old (non-engineering) college undergraduates • Like 3D LOGO… …with “threads” Alice is Not... • • • • Modeler / CAD Package Keyframing Multimedia Authoring VRML Authoring What Is Alice For? • • • • • Animated Illustrations Games Small Virtual Worlds Rapid Prototyping Teaching? • Question really is: “What is 3D graphics for?” Alice 99 & Squeak Alice • Alice 99 – Developed by Stage 3 Research group, Randy Pausch director, at UVA and CMU • Squeak Alice – Port of Alice to Squeak – Draws on the lessons learned, but lacks some functionality Alice 99 Architecture Visual Basic Alice Interface User Scripts Alice OOP Classes Animation Engine Simulation Scheduler Database/Matrix Services C / C++ Extension Libraries (Ex. UNC particle system) Microsoft Direct 3D (Retained Mode ) Squeak Alice Architecture Morphic Interface User Scripts Wonderland Classes (Actors, Animations, Cameras, Scheduler, etc.) Database/Matrix Services Balloon 3D (Immediate Mode) Key Squeak Alice Classes • Wonderland – Encapsulates a 3D world • Scheduler – Responsible for making time pass • WonderlandActor – Encapsulates behaviors for actors • WonderlandCamera – Responsible for drawing the world The Alice Main Loop DO Forever Process Any Input Events FOR Each Scheduled Animation DO Update Affected Objects FOR Each Camera DO Render the Updated World Demo Design Philosophy • • • • Focus on Behavior Specification Observe the 90/10 Rule All Tradeoffs in Favor of the Novice Let the Tutorial Drive the Design Tutorial Drives the Design • Two Parts: – Design – Teaching • As designers, we control both halves • Teaching influences design Research Approach • Psychology/Linguistic Literature – inspires and informs good decisions – does not dictate • User Observation – ferrets out bad decisions • Need Both User Observation • N > 120 • Two Person Talk Aloud Protocol – eavesdropping • Critical Incident Reporting – exit interviews after extended use Outline • • • • • About Alice Some Lessons Learned Advanced Functionality Building An Alice World Building Virtual Worlds: the class First, a disclaimer... You (and I) are not our users... 99% 99% My Our Users Users 1% You Are Here You (and I) are not our users... 99% 99% My Our Users Users 1% You Are Here ...but your students are XYZ Considered Harmful Avoid Small Cognitive Hit on Every Operation forward up left Vocabulary Matters • • • • • • X, Y, Z Translate Rotate Scale Depth RGB Triples • (0, 0, 255) Left, Up, Forward Move Turn Resize FrontToBack Color names blue Controlled Exposure To Power: Animation • Extend, Don’t Abandon Knowledge • Optional Keywords • Allow combinations when possible Distance = Speed x Time • Duration • Speed • Style (interpolation function) Animation Examples • • • • • • • bunny move: up bunny move: up distance: 1 bunny move: up distance: 1 duration: 5 bunny move: up distance: 1 speed: 2 bunny move: up speed: 2 bunny move: up speed: 2 for: 5 bunny move: up distance: 1 style: abruptly All Actors Are Reference Frames • Controlled Exposure To Power • Optional asSeenBy keyword bunny move: forward distance: 1 bunny move: forward distance: 1 asSeenBy: camera • Direct 3D 5.0 UP is Fundamental • • • • • Essential like cameras and lights Not gravity, Just “Up” Panning cameras pointAt: Even without a ground plane, observer supplies an “Up” vector Turning at Speed • bunny turn: left speed: 2 • Units? Turns/Second 22 RPM 9 Unitless 1-10 7 Fast/Medium/Slow 6 Degrees/Second 3 Seconds/Turn 2 Radians/Second 1 N=50 Turns/Second 22 RPM 9 Unitless 1-10 7 Fast/Medium/Slow 6 Degrees/Second 3 Seconds/Turn 2 Radians/Second 1 N=50 Turn • There are only two kinds of turning • bunny turn: left turns: 1 • bunny turn: right turns: 1 • bunny turn: forward turns: 1 • bunny turn: back turns: 1 Roll Is… • Invisible to 70% of Subjects • bunny roll: left turns: 1 • bunny roll: right turns: 1 Parts • First-Class and Part properties • Distinct from Parent-Child relationship • Boundaries in the scene graph More About Parts • More than Picking – property setting (color) – delete Table Ball Legs (parts) More About Parts • More than Picking – property setting (color) – delete Table Ball Legs (parts) Pulling Objects Apart • Is it still a part? Scale (Resize) • bunny resize: 0.5 • Scale is a terrible term • Many Traditional APIs – Matrix Scale == Scaled Space • Alice – Tracks the scale factor, later operations scaled back. A meter is always a meter. Numbers Matter • Importance of 0 and 1 – Users often try 1 when they need a number – Alice uses 0..1 for all bounded ranges • Novices do not understand “magic ranges” (0..255, 0..32767) • 1/4 = 0.25, not 0 • We changed integer division in Python • Not a problem in Squeak Undo • • • • • Make “what if” cost-free Animates Users are insensitive to duration Users are sometimes sensitive to path Some operations tricky – start an animation, then UNDO Problems With Scripting • Case sensitivity (85%) • Bunny and bunny the same for novices • We made Python case insensitive • This is problematic for Squeak • Typing (63%) • Syntax (45%) – parentheses, dots, commas Novices Want End-to-End Teddy 2 by Takeo Igarashi 3D Paint Tool by Dennis Cosgrove Outline • • • • • About Alice Some Lessons Learned Advanced Functionality Building An Alice World Building Virtual Worlds: the class Some Higher Level Commands • • • • • • obj1 pointAt: obj2 obj1 alignWith:obj2 obj1 place: onTopOf object: obj2 obj1 standUp obj1 destroy: 2 obj1 resizeLikeRubber dimension: topToBottom Animations Are Objects spin spin spin spin spin := bunny turn: left turns: 1 pause resume stop start spin loop: 2 spin loop spin stopLooping Composing Animations jump := bunny move: up distance: 1. fall := bunny move: down distance: 1. hop := w doInOrder: {jump. fall}. hop start spinJump := w doTogether: {hop. bunny turn: left turns: 1}. spinJump loop Adding Responses newReaction := bunny respondWith: [:event | bunny turn: left turns: 1] to: leftMouseClick bunny addResponse: [:event | bunny move: up distance: 2] to: leftMouseClick bunny removeResponse: newReaction to: leftMouseClick Outline • • • • • About Alice Some Lessons Learned Advanced Functionality Building An Alice World Building Virtual Worlds: the class The Process • (1) Create Models – Objects created in external CAD Packages – Alice reads common polygonal 3D file formats • (2) Paint Textures on Models – Unfolding and (U,V) coordinate mapping – Good tools somewhat rare on PC • (3) Scripting ALICE Alice World = Opening Scene + Script whiz = box.turn(left, Rate=20) box.setReaction(LeftMouseDown, whiz) (Squeak Alice lacks the Opening Scene mechanism) Opening Scene • Insert Objects Via Menus • Drive Camera(s) into position • Tweak the scene – Direct Manipulation – GUI tools – command box • Save Making and Running Scripts • Define Behaviors • Launch Behaviors • As program runs evaluate new code – command box – GUI tools – Direct Manipulation • Reset / Undo when necessary Outline • • • • • About Alice Some Lessons Learned Advanced Functionality Building An Alice World Building Virtual Worlds: the class Building Virtual Worlds • Semester-long course at CMU • Mix of computer science, art, drama, design, and architecture students • Every 2-3 weeks (6 projects total) – students randomly assigned to new interdisciplinary group of 4-5 people – must build a virtual world using Alice • Open showcase at end of semester Video Availability • Alice 99 – Runs on Windows 95 / 98 / 2000 / NT / XP – Free – http://www.alice.org • Squeak Alice – Runs on anything Squeak does – Free – http://www.squeak.org The Authors Matthew Conway, Steve Audia, Tommy Burnette, Dennis Cosgrove, Kevin Christiansen, Rob Deline, Jim Durbin, Rich Gossweiler, Shuichi Koga, Chris Long, Beth Mallory, Steve Miale, Kristen Monkaitis, James Patten, Jeff Pierce, Joe Shochet, David Staack, Brian Stearns, Richard Stoakley, Chris Sturgill, John Viega, Jeff White, George Williams, Randy Pausch Lessons Learned from Building a 3D System for Novices http://www.alice.org Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu