introduction to alice

39
Introduction to Alice Alice is named in honor of Lewis Carroll’s Alice in Wonderland

Upload: griffith-wyatt

Post on 02-Jan-2016

96 views

Category:

Documents


3 download

DESCRIPTION

Introduction to Alice. Alice is named in honor of Lewis Carroll’s Alice in Wonderland. How To Get Your Free Copy. Can download from the web www.alice.org. Why Alice?. A modern programming tool 3-D graphics 3-D models of objects Animation - PowerPoint PPT Presentation

TRANSCRIPT

Introduction to Alice

Alice is named in honor of Lewis Carroll’s Alice in Wonderland

How To Get Your Free Copy

Can download from the webwww.alice.org

Why Alice?A modern programming tool

3-D graphics3-D models of objects

Animationobjects can be made to move around the virtual world (a video game or simulation implemented in 3-D)

What does Alice run on?

Alice is written in Java -- this helps the software run on many popular systems

Right now, the software team is working to support only the PC version

Fast Start Up

Can quickly learn to create a simple animation in a matter of minutes

An animated story in a few lab sessions

Can learn to use the Alice interface in a couple of lab sessions

The Power of Alice

Automatically keeps track of 3-D objects what objects are in the virtual world

types of objects

positions of objects in the world

Demo

Starting Alice

Running A World

How to Exit

What to do if Alice crashes

Memory Management

Alice automatically manages memoryBut, writing and testing an animation is an intense load on the computing system – a crash can occur.

Best solution: save your world every 15 minutes

(Or at least every half hour)

also save to a backup system (for example, a usb key)

Object PositionObjects

are positioned in 3-D space

Have six degrees of freedom (directions of movement)

Galleries of 3D Objects

Sources of 3D objects the local gallery shipped with the software

Alice web gallery

Kinds of Animations

Movieuser just watches the animation on screen

"machine-centric"

Interactiveuser clicks on mouse, types a key on

keyboard …

"user-centric"

Events

Animations that are interactive depend on the user's actions

mouse click

key press

Actions are events

Interactive programs are event-driven

Objects

What is an object ? anything that can be identified as unique from other things

How is an object identified as unique? has a name has properties:

width, height, color, location, age, ss#, id#

has a purpose:associated actions it can performtasks it can carry out

ClassObjects are categorized into classes

Each object is an instance of the class.

All objects in a class have similar properties and generally can perform the same tasks.

Person

Dogs

Peter

Mary

Paul

Spike

Scottie

Fluffy

Objects in a Virtual World

In Alice, each 3D model is a class of objects

each object of the class has a unique namemummy, mummy1, mummy2

has color(s)pink, white, grey, black, blue, ….

Object Parts

Objects may be composed of Parts

Animation Programs: Scenarios and Storyboards

Alice

Overview

2-step process for creating animationsStep 1: Design

Step 2: Implementation

Step 1: Design

Decide on the problem to be solvedOften the problem to be solved is given to you by your instructor, boss, etc.

Other times, you get to make it up!

We will practice both

Design a solution We will use a storyboard design

An example problem (scenario)

The scenario is: Several snow-people are outdoors, on a snow-

covered landscape. A snowman is trying to meet a snowwoman who is talking with a group of her friends (other snowwomen.) He says "Ahem" and blinks his eyes, trying to get her attention.

The problem is: How can we create this animation?

Designing a solution

First decide on the objects that will be in the scene.Then, create a storyboard.

A "storyboard" is a representation of what actions are going to take place in the animationA storyboard can take two forms

sketches textual "to do" lists

Objects in the SceneObjects: A snowman and a snowwoman (and possibly other snowpeople)

Opening Scene: a snowy scene

A quick sketch:

A Storyboard

Initial scene Snowman tries to catch snowwoman’s attention

Snowwoman looks around

Storyboard in Text Form

Animation Artists (for example, at Disney or Pixar Studios) sketch their storyboardsYou may not have such expertise, so here is a textual form that can be used:

This is like a "to-do" list.

Snowman turns to face snowwoman.

Snowman “makes eyes” and calls out to snowwoman.

Snowwoman turns around.

Creating An AnimationProgram

Alice

Step 2: Implementation

Implementing an animation requires Setting Up the Initial Scene in Alice

Writing the Program (Script)

Create Initial Scene

Techniques and Tools

Mouse used toset up the initial sceneapproximately position objects in the scene

Camera Navigation is used toset the camera point of view

Drop-down menu methods are used to resize objectsmore precisely position objects in the scene

Scene Editor's Layout Manager is used toobtain specific alignmentsposition one object relative to another object

Writing A Program

"Writing" a program (script) a list of instructions to have the objects perform certain actions in the animation

Writing the Program

Our planned storyboard (to-do list) is:

The idea now is to translate the design steps to program instructions.

Snowman turns to face snowwoman.

Snowman “makes eyes” and calls out to snowwoman.

Snowwoman turns around.

Translating the Design

Some steps in the storyboard can be written as a single instruction

The snowman turns to face the snowwoman

Other steps are composite actions that require more than one instruction

The snowman tries to catch the snowwoman’s attention is two actions

Snowman says “ahem”

Snowman raises and lowers his eyes

Actions

Sequential Some actions occur one after the other

first step (snowman turns to face snowwoman)

second step (snowman tries to get snowwoman’s attention)

SimultaneousOther actions occur at the same time

Snowman says "Ahem" and while simultaneously blinking his eyes

Action Blocks in Alice

Sequential Action Block

Simultaneous Action Block

Write the Animation Program

Will develop in class.

Note: Snow people can be found “locally”and are in the people folder.

Coding the first 2 steps

Things to note: Nesting of DoTogether and DoInOrder blocks

Arguments for the move instruction direction

distance

Testing

An important step in creating a program is to run it – to be sure it does what you expect it to do.

We recommend that you use an incremental development process:

write a few lines of code and then run it

write a few more lines and run it

write a few more lines and run it…

This process allows you to find any problems and fix them as you go along.

Comments

While Alice instructions are easy to understand, it is often desirable to be able to explain (in English) what is going on in a program

We use comments to explain to the human reader what a particular section of code does

Notes:

1) Comments appear in green

2) Alice ignores comments.

3) Comments make the program easier to read.

In the previous example, the comment described a large block of program code.

Comments also can be used for a small subsection of the program code.