Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University...

Post on 17-Jan-2016

219 views 0 download

Tags:

transcript

Lessons Learned from Building a 3D System for Novices

Jeff PierceCarnegie Mellon University

jpierce@cs.cmu.edu

OutlineOutline

• About Alice• Some Lessons Learned• Advanced Functionality• Building An Alice World• Building Virtual Worlds: the class

The ProblemThe 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...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...Alice is Not...

• Modeler / CAD Package• Keyframing • Multimedia Authoring• VRML Authoring

What Is Alice For?What Is Alice For?

• Animated Illustrations• Games• Small Virtual Worlds• Rapid Prototyping• Teaching?

• Question really is: “What is 3D graphics for?”

Alice 99 & Squeak AliceAlice 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 ArchitectureAlice 99 Architecture

Microsoft Direct 3D (Retained Mode )

Alice OOP ClassesAnimation EngineSimulation Scheduler

User Scripts

C / C++ Extension Libraries(Ex. UNC particle system)

Visual Basic Alice Interface

Database/Matrix Services

Squeak Alice ArchitectureSqueak Alice Architecture

Balloon 3D (Immediate Mode)

Wonderland Classes(Actors, Animations, Cameras,

Scheduler, etc.)

User Scripts

Morphic Interface

Database/Matrix Services

Key Squeak Alice ClassesKey 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 LoopThe 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 PhilosophyDesign 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 DesignTutorial Drives the Design

• Two Parts:– Design– Teaching

• As designers, we control both halves

• Teaching influences design

Research ApproachResearch Approach

• Psychology/Linguistic Literature– inspires and informs good

decisions– does not dictate

• User Observation– ferrets out bad decisions

• Need Both

User ObservationUser Observation

• N > 120• Two Person Talk Aloud Protocol

– eavesdropping • Critical Incident Reporting

– exit interviews after extended use

OutlineOutline

• About Alice• Some Lessons Learned• Advanced Functionality• Building An Alice World• Building Virtual Worlds: the class

First, a disclaimer...

You (and I) You (and I) are not our users...are not our users...

99%My Users

1%You Are Here

99%Our Users

You (and I) You (and I) are not our users...are not our users...

99%My Users

1%You Are Here

...but your students are...but your students are

99%Our Users

XYZ Considered HarmfulXYZ Considered Harmful

Avoid Small CognitiveHit on Every Operation

up

forward left

Vocabulary MattersVocabulary Matters

• X, Y, Z Left, Up, Forward• Translate Move• Rotate Turn• Scale Resize• Depth FrontToBack• RGB Triples Color names

• (0, 0, 255) blue

Controlled ExposureControlled ExposureTo Power: AnimationTo Power: Animation

• Extend, Don’t Abandon Knowledge• Optional Keywords• Allow combinations when possible

Distance = Speed x Time

• Duration• Speed• Style (interpolation function)

Animation ExamplesAnimation Examples

• bunny move: upbunny move: up• bunny move: up distance: 1bunny move: up distance: 1• bunny move: up distance: 1 duration: 5bunny move: up distance: 1 duration: 5• bunny move: up distance: 1 speed: 2bunny move: up distance: 1 speed: 2• bunny move: up speed: 2bunny move: up speed: 2• bunny move: up speed: 2 for: 5bunny move: up speed: 2 for: 5• bunny move: up distance: 1 bunny move: up distance: 1

style: abruptlystyle: abruptly

All Actors Are All Actors Are Reference FramesReference Frames

• Controlled Exposure To Power• Optional asSeenBy keyword

bunny move: forward distance: 1bunny move: forward distance: 1bunny move: forward distance: 1 bunny move: forward distance: 1

asSeenBy: cameraasSeenBy: camera

• Direct 3D 5.0

UP is FundamentalUP 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 SpeedTurning at Speed

• bunny turn: left speed: 2

• Units?

1

9

2

3

6

7

22Turns/Second

RPM

Unitless 1-10

Fast/Medium/Slow

Degrees/Second

Seconds/Turn

Radians/SecondN=50

1

9

2

3

6

7

22Turns/Second

RPM

Unitless 1-10

Fast/Medium/Slow

Degrees/Second

Seconds/Turn

Radians/SecondN=50

TurnTurn

• There are only two kinds of turning

• bunny turn: left turns: 1bunny turn: left turns: 1• bunny turn: right turns: 1bunny turn: right turns: 1

• bunny turn: forward turns: 1bunny turn: forward turns: 1• bunny turn: back turns: 1bunny turn: back turns: 1

Roll Is… Roll Is…

• Invisible to 70% of Subjects

• bunny roll: left turns: 1bunny roll: left turns: 1• bunny roll: right turns: 1bunny roll: right turns: 1

PartsParts

• First-Class and Part properties

• Distinct from Parent-Child relationship

• Boundaries in the scene graph

More About PartsMore About Parts

• More than Picking– property setting (color) – delete

Table

Legs (parts)Ball

More About PartsMore About Parts

• More than Picking– property setting (color) – delete

Table

Legs (parts)Ball

yank!

Pulling Objects ApartPulling Objects Apart

• Is it still a part?

Scale (Resize)Scale (Resize)

• bunny resize: 0.5bunny 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 MatterNumbers 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

UndoUndo

• 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 ScriptingProblems 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-EndNovices Want End-to-End

3D Paint Toolby Dennis Cosgrove

Teddy 2 by Takeo Igarashi

OutlineOutline

• About Alice• Some Lessons Learned• Advanced Functionality• Building An Alice World• Building Virtual Worlds: the class

Some Higher Level CommandsSome 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 ObjectsAnimations Are Objects

spin := bunny turn: left turns: 1

spin pause

spin resume

spin stop

spin start

spin loop: 2

spin loop

spin stopLooping

Composing AnimationsComposing 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 ResponsesAdding Responses

newReaction :=

bunny respondWith: [:event | bunny turn: left turns:

1] to: leftMouseClick

bunny addResponse:[:event | bunny move: up distance: 2]

to: leftMouseClick

bunny removeResponse: newReactionto: leftMouseClick

OutlineOutline

• About Alice• Some Lessons Learned• Advanced Functionality• Building An Alice World• Building Virtual Worlds: the class

The ProcessThe 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) ScriptingALICE

Alice World = Alice World = Opening Scene Opening Scene

+ + Script Script

whiz = box.turn(left, Rate=20)

box.setReaction(LeftMouseDown, whiz)

(Squeak Alice lacks the Opening Scene mechanism)

Opening SceneOpening Scene

• Insert Objects Via Menus• Drive Camera(s) into position• Tweak the scene

– Direct Manipulation – GUI tools– command box

• Save

Making and Running Scripts Making and Running Scripts

• Define Behaviors• Launch Behaviors• As program runs evaluate new code

– command box– GUI tools– Direct Manipulation

• Reset / Undo when necessary

OutlineOutline

• About Alice• Some Lessons Learned• Advanced Functionality• Building An Alice World• Building Virtual Worlds: the class

Building Virtual WorldsBuilding 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

AvailabilityAvailability

• 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 AuthorsThe 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

Jeff PierceCarnegie Mellon University

jpierce@cs.cmu.edu

http://www.alice.org