+ All Categories
Home > Documents > Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University...

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

Date post: 17-Jan-2016
Category:
Upload: isabella-taylor
View: 219 times
Download: 0 times
Share this document with a friend
Popular Tags:
56
Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University [email protected]
Transcript
Page 1: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

Lessons Learned from Building a 3D System for Novices

Jeff PierceCarnegie Mellon University

[email protected]

Page 2: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

OutlineOutline

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

Page 3: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

Page 4: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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”

Page 5: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

Alice is Not...Alice is Not...

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

Page 6: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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?”

Page 7: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

Page 8: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

Page 9: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

Squeak Alice ArchitectureSqueak Alice Architecture

Balloon 3D (Immediate Mode)

Wonderland Classes(Actors, Animations, Cameras,

Scheduler, etc.)

User Scripts

Morphic Interface

Database/Matrix Services

Page 10: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

Page 11: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

Page 12: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

Demo

Page 13: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

Page 14: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

Tutorial Drives the DesignTutorial Drives the Design

• Two Parts:– Design– Teaching

• As designers, we control both halves

• Teaching influences design

Page 15: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

Research ApproachResearch Approach

• Psychology/Linguistic Literature– inspires and informs good

decisions– does not dictate

• User Observation– ferrets out bad decisions

• Need Both

Page 16: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

User ObservationUser Observation

• N > 120• Two Person Talk Aloud Protocol

– eavesdropping • Critical Incident Reporting

– exit interviews after extended use

Page 17: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

OutlineOutline

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

Page 18: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

First, a disclaimer...

Page 19: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

99%My Users

1%You Are Here

99%Our Users

Page 20: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

Page 21: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

XYZ Considered HarmfulXYZ Considered Harmful

Avoid Small CognitiveHit on Every Operation

up

forward left

Page 22: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

Page 23: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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)

Page 24: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

Page 25: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

Page 26: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

Page 27: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

Turning at SpeedTurning at Speed

• bunny turn: left speed: 2

• Units?

Page 28: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

1

9

2

3

6

7

22Turns/Second

RPM

Unitless 1-10

Fast/Medium/Slow

Degrees/Second

Seconds/Turn

Radians/SecondN=50

Page 29: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

1

9

2

3

6

7

22Turns/Second

RPM

Unitless 1-10

Fast/Medium/Slow

Degrees/Second

Seconds/Turn

Radians/SecondN=50

Page 30: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

Page 31: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

Page 32: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

PartsParts

• First-Class and Part properties

• Distinct from Parent-Child relationship

• Boundaries in the scene graph

Page 33: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

More About PartsMore About Parts

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

Table

Legs (parts)Ball

Page 34: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

More About PartsMore About Parts

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

Table

Legs (parts)Ball

Page 35: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

yank!

Pulling Objects ApartPulling Objects Apart

• Is it still a part?

Page 36: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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.

Page 37: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

Page 38: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

Page 39: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

Page 40: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

Novices Want End-to-EndNovices Want End-to-End

3D Paint Toolby Dennis Cosgrove

Teddy 2 by Takeo Igarashi

Page 41: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

OutlineOutline

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

Page 42: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

Page 43: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

Page 44: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

Page 45: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

Page 46: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

OutlineOutline

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

Page 47: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

Page 48: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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)

Page 49: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

Opening SceneOpening Scene

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

– Direct Manipulation – GUI tools– command box

• Save

Page 50: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

Page 51: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

OutlineOutline

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

Page 52: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

Page 53: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

Video

Page 54: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

Page 55: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

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

Page 56: Lessons Learned from Building a 3D System for Novices Jeff Pierce Carnegie Mellon University jpierce@cs.cmu.edu.

Lessons Learned from Building a 3D System for Novices

Jeff PierceCarnegie Mellon University

[email protected]

http://www.alice.org


Recommended