To solve a problem (perform a task) in a virtual world, we must accomplish the following:

Similar documents
Introduction to Alice

The Basics. By Jenna Hayes under the direction of Professor Susan Rodger Duke University July

Demo. Getting Started with Alice Demo

Part II Coding the Animation

ALICE TUTORIAL. Introduction to Alice 3

Princess & Dragon Version 2

Image Editor. Opening Image Editor. Click here to expand Table of Contents...

After you launch StoryO, you will see 5 sample projects in the Projects screen. To sample a project, click on the name of the project.

Animating objects 1. We want the graphic we just created to appear in the following sequence.

Creating a Historical Tour in Alice

GAME PROGRAMMING & DESIGN LAB 1 Egg Catcher - a simple SCRATCH game

Scratch for Beginners Workbook

Computer with Scratch program.

Moving Man Introduction Motion in 1 Direction

Princess & Dragon Part 2: Teaching a Dragon to Fly Methods & Proper:es

ArbStudio Triggers. Using Both Input & Output Trigger With ArbStudio APPLICATION BRIEF LAB912

ISET Selecting a Color Conversion Matrix

How Tall Are You? Introducing Functions

Alice Learning to program: Part Two by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2008

LESSON 04: ORGANIZE IT FOR PSE USERS COMPANION BOOK. Digital Scrapbook Academy. April 2018: Lesson 04 Organize It for Elements Users

Adding Content and Adjusting Layers

CS Problem Solving and Structured Programming Lab 1 - Introduction to Programming in Alice designed by Barb Lerner Due: February 9/10

Programming with Scratch

Prasanth. Lathe Machining

Objects in Alice: Positioning and. Moving Them July 2008

Part II: Number Guessing Game Part 2. Lab Guessing Game version 2.0

Note: Objective: Prelab: ME 5286 Robotics Labs Lab 1: Hello World Duration: 1 Week

Photo Story Tutorial

Annex IV - Stencyl Tutorial

Solidworks Tutorial Pencil

Dimension Properties. Student Web Site

Create Account Featured, Most Recent, Most Discussed Top Rated)

This lesson will focus on advanced techniques

Graphing Motion Simulation 8 th Grade PSI Score / 23 points. Learning Goals: Be able to describe movement by looking at a motion graph

Introduction: Alice and I-CSI110, Programming, Worlds and Problems

SqueakCMI Notebook: Projects, Tools, and Techniques

Table of Contents. Creating Your First Project 4. Enhancing Your Slides 8. Adding Interactivity 12. Recording a Software Simulation 19

Microsoft MakeCode for

2

Creating Computer Games

COMPUTER GENERATED ANIMATION

Once you have chosen the water world this is how your screen should look.

Module 2: Radial-Line Sheet-Metal 3D Modeling and 2D Pattern Development: Right Cone (Regular, Frustum, and Truncated)

OZOBLOCKLY BASIC TRAINING LESSON 1 SHAPE TRACER 1

The original image. The final rainbow effect.

The Essen(als of Alice (Bunny) By Jenna Hayes under the direc(on of Professor Susan Rodger Duke University July 2008

Fundamentals of ModelBuilder

Figure AC circuit to be analyzed.

Curriculum Department Bristol City Schools Bristol, TN

DESIGN A SHOOTING STYLE GAME IN FLASH 8

Organizing artwork on layers

Converting a solid to a sheet metal part tutorial

Introducing Scratch Game development does not have to be difficult or expensive. The Lifelong Kindergarten Lab at Massachusetts Institute

Inspiring Creative Fun Ysbrydoledig Creadigol Hwyl. Kinect2Scratch Workbook

NOVA technical note #8 1. Case study: how to use cutoff conditions in a FRA frequency scan?

Ansoft Designer Tutorial ECE 584 October, 2004

Introduction to CATIA V5

Let s start by making a pencil, that can be used to draw on the stage.

PHYSICS 220 LAB #1: ONE-DIMENSIONAL MOTION

Challenge 1: Tami s World

Scratch LED Rainbow Matrix. Teacher Guide. Product Code: EL Scratch LED Rainbow Matrix - Teacher Guide

KEEPING SCORE: HOW TO USE SCORES, LIVES AND HEALTH

Ensure that you have downloaded all the dataset files from your course Resources, and that they are extracted to the route of your C: drive.

Learning to Program: Part 2 Wri0ng Methods and Events

Introduction to Simulink Assignment Companion Document

In this video tutorial, we re going to take a look at continuity editing and how we can use editing techniques to compress time.

FLEXLINK DESIGN TOOL VR GUIDE. documentation

A Virtual Environments Editor for Driving Scenes

Programming I (mblock)

Alice: A Visual Introduction to Programming. Chapter 1 Part 2

G54GAM Lab Session 1

Instructions.

Creo Extrude Tutorial 2: Cutting and Adding Material

Writing Interactive Fiction With Adrift

a. the costumes tab and costumes panel

Use Linear Regression to Find the Best Line on a Graphing Calculator

New Sketch Editing/Adding

Learn about the RoboMind programming environment

Fish Chomp. Level. Activity Checklist Follow these INSTRUCTIONS one by one. Test Your Project Click on the green flag to TEST your code

PROJECT REPORT: GAMING : ROBOT CAPTURE

This Photoshop Tutorial 2012 Steve Patterson, Photoshop Essentials.com. Not To Be Reproduced Or Redistributed Without Permission.

Lesson 1 Getting Started. 1. What are the different ways you interact with computers?

Learn how to. Link to Club Penguin. Link to Club Penguin. Link to Club Penguin. Movie Clip

Introduction to Parametric Modeling AEROPLANE. Design & Communication Graphics 1

In this lesson we are going to create cartoon eyes and parent them to the head bone.

Lost in Space. Introduction. Scratch. You are going to learn how to program your own animation! Activity Checklist.

What Filters Are All About

Chapter 1 Virtual World Fundamentals

Get the Max out of Your Autodesk Architectural Desktop Drawings in Autodesk VIZ

Creating Digital Stories for the Classroom

Lesson 4 Extrusions OBJECTIVES. Extrusions

Note: Objective: Prelab: ME 5286 Robotics Labs Lab 1: Hello Cobot World Duration: 2 Weeks (1/28/2019 2/08/2019)

CONCEPTS EXPLAINED CONCEPTS (IN ORDER)

Kaltura CaptureSpace Lite Desktop Recorder: Editing, Saving, and Uploading a Recording

Tutorial 1 getting started with the CNCSimulator Pro

Motion Blur with Mental Ray

A tutorial on scripted sequences & custsenes creation

A Quick Spin on Autodesk Revit Building

The editor was built upon.net, which means you need the.net Framework for it to work. You can download that here:

A User s Guide to the Robot Virtual Worlds App RVW APP. ROBOTC Graphical Programming. Virtual Programming Challenges to Foster Computational Thinking

Transcription:

Chapter 3 Animation at last! If you ve made it to this point, and we certainly hope that you have, you might be wondering about all the animation that you were supposed to be doing as part of your work with Alice. Well, the time has arrived to start doing some animations! Creating an animation in a virtual world is a problem solving task. The solution to the problem consists of two parts: creating the initial scene, and writing a script to generate the actual animation. Well, by now, you ve had a fair bit of practice in creating an opening scene, so it is about time to create the second part of the solution (an animation). Before we begin developing an animation, we need to talk about the problem solving process. In other words, at some abstract level, how do we solve animation problems? To solve a problem (perform a task) in a virtual world, we must accomplish the following: 1) define the problem setting -- the opening scene, 2) determine the object(s) and parts that will perform the task, 3) place the object(s) at a beginning location in the opening scene, and 4) supply a list of instructions (commands) to perform the task. These steps are all part of the problem solving process. The result of our work is an opening scene for the virtual world and a script. A script (also called a program) is a collection of commands that tells Alice what actions the objects are to perform in the virtual world. You can think of an Alice script as being somewhat like a script for a theatrical play. The theatrical script outlines the actions to be taken by actors on stage while an Alice script outlines the actions to be taken by objects in a virtual world. The remaining portion of this section uses an example to model the problem solving process, as used with Alice. Alice Problems: Tasks and Situations We define a problem as consisting of two parts: A task to be performed. This is generally some animation we want to do. A world situation. A situation tells us what we know about the Alice world at a particular instant in time. The situation includes the location of any objects and the original scene. There are three kinds of situations:

The initial situation This is the situation at the start of a task. The objects of interest are the opening scene and original positions of the objects that make up that scene. The intermediate situation This is the situation that occurs at any time during the action, between the start of the task and its conclusion. The final situation This is the situation at the conclusion of the task. Let us explain an animation problem by means of an example. Suppose we have the White Rabbit and a Butterfly positioned as shown in the initial situation, Figure 3-0-1 below. What we would like to accomplish (our task) is to have the White Rabbit walk over to the Butterfly. By "walk", we mean animate the legs of the rabbit as it moves toward the Butterfly, so that it appears that the White Rabbit is actually walking. Figure 3-0-1. The initial situation As the animation progresses, the White Rabbit will begin walking towards the Butterfly. At some time during the animation, we would see an intermediate situation where the rabbit has walked part of the way toward the Butterfly. In the intermediate situation shown in Figure 3-0-2, the rabbit's right leg is "in the air." Figure 3-0-2. An intermediate situation 2

Note that there are several intermediate situations. We have just shown the intermediate situation that has occurred about one third of the White Rabbit s walk towards the Butterfly. At last, we see the final situation in Figure 3-0-3. The White Rabbit has completed its walk and is now just behind the butterfly. Figure 3-0-3. The final situation Obviously, we could use the mouse to move the rabbit from the initial situation to the final situation. But, that is not what we really want to do. In order to make our animation appear realistic, we want the White Rabbit to move its legs in a pattern that make it look like it is walking as it moves across the world. The mouse cannot be used to move the parts of the rabbit and we want the rabbit's legs to appear to be walking. work. Let us now take a look at the script we will need to write to make this animation Writing our first Alice Program Let us start with the 4 problem solving steps (from the above discussion). For step 1: We need to define the task. We can define it as follows: "Suppose that we have the White Rabbit and the Butterfly positioned on a default world (as shown in Figure 3-0-1). Our task is to have the White Rabbit walk over to the Butterfly." For step 2: We need to know what objects and parts we will need. We need the Default Scene, the White Rabbit, and the Butterfly. What parts will we need? Taking a look at the object tree (after clicking on the + to the left of the White Rabbit), we see: 3

As we want the White Rabbit to walk, we are probably going to need to work with the White Rabbit s rleg (right leg) and his lleg (left leg). For step 3: We need to place the objects in their starting positions. Here is a possible initial scene that we could create for the animation. It contains all of the objects we will need. 4

Figure 12 Initial Scene Note that on the top center of the screen is the tab Opening Scene. That is because we are creating the opening scene. Next to that tab is a tab for Animations. By clicking on the Animations tab, we open an editor where we can write the animation sequence for moving the White Rabbit to the Butterfly. Animations Editor Hidden behind the Opening Scene is an Animation editor. In the computer science community, the term program (or program code) is often used when talking about a script or animation sequence. We will use the terms interchangeably. In the Alice interface, a program is a list of actions (instructions) to be performed by Alice and the objects in the virtual world. For step 4: We will use the Animation editor to write the instructions for the White Rabbit to walk in the world. Walking forward, of course, is a translational motion. So, the instruction that springs to mind is the Move() instruction. Of course, our script should probably consist of several move instructions. We'll issue a command to have the rabbit pick up its left foot. Then, we'll have the rabbit move forward followed by putting 5

its left foot back down. Let s try this out to see how it looks. The Animations window looks something like the following: To begin with, click the + to the left of the WhiteRabbit in the object tree. This is because we want to move the White Rabbit s right leg. Now, click on the word.rleg that appears below the White Rabbit with the left mouse button. With the button clicked, drag the rleg directly underneath the Action1 = DoInOrder line in the main Animation window. When you release the mouse button, you should see something like the following: 6

Now, select Move from the pull down menu, and select Up from the next pull down menu, and Other from the next pull down menu. Then enter a value of 1/16. Your command should look like the following: Now we would like to move the whole White Rabbit forward while we have the White Rabbit put its foot back down again. To move the White Rabbit forward, use the left mouse button and click on the White Rabbit in the object tree. Drag the mouse to a location immediately below the WhiteRabbit.rleg.Move(Up, 1/16,more ) line, and then select Move (from the drop down menu), then select Forward (from the next drop down menu), then select Other, and enter in a value of ¼. Your new script should look like the following: Now, add a command to move the White Rabbit s right leg (rleg) back down 1/16, so that your resulting script appears as follows: 7

This sequence of animations moves the White Rabbit forward one step. As the White Rabbit is approximately 4 steps from the Butterfly, we should repeat this sequence of animation steps 4 times, once with the right leg, once with the left, once with the right, and then finally with the left leg. The resulting script should look something like the following: Now we are ready to try out the animation! Click on the Start button. The White Rabbit picks up its right leg. Then it moves its whole body forward. Then it moves its right leg back down. This entire motion is somewhat stilted The problem is that Alice executes all of the move commands in our script sequentially. So, the White Rabbit must move completely forward before it begins to put its leg down. To get around this problem, Alice provides two special commands that only work in a script (where the sequencing of commands is important): DoInOrder(), and DoTogether(). The DoInOrder() command means that all of the commands which occur inside the command are performed one right after another, not at the same time. DoTogether() means that all of the commands which occur inside of the command are done at the same time. So, if we want the White Rabbit to walk in a more realistic fashion, we should perform the whole body move and the placing of the leg back on the ground at the same time. To do this, click with the left mouse button on the word DoTogether located below the word Combinations on the left of the screen, and drag it in between instructions 1 and 2: 8

Now, left mouse click on the 3 next to the instruction WhiteRabbit.Move(Forward,1/4,more ). Drag the 3 to just below the DoTogether, resulting in the following: Repeat the same for the 3 next to the instruction WhiteRabbit.rleg.Move(Down,1/16,more ). Drag the 3 to just below the line WhiteRabbit.Move(Forward,1/4,more ), resulting in the following: 9

Repeat the same steps for each of the other 3 steps to result in a script that looks like the following: Let us examine the script in more detail. The first statement, DoInOrder(), tells Alice to execute the statements one by one. However, we do still want two of the instructions to be performed together (namely the White Rabbit moving forward and putting its foot down). So we use a DoTogether() control statement for that purpose. With this new modification, the White Rabbit now walks! 10

The White Rabbit's walk is still a little bit on the "stilted" side, so we take advantage of one of the keywords associated with the Move() instruction, the duration= keyword. (Keywords are further discussed in the next section of this chapter.) This keyword modifies the Move() instruction by indicating how long Alice should take in running a particular command. The default value (if you do not specify this keyword) is 1 unit of time. To add this keyword to a move command, click (with the left mouse button) on the more on the right side of each command, and select the Duration keyword from the drop down box. Now, specify an appropriate duration. So here is the (once again) modified code for the animation: Now, Start the animation, and watch the White Rabbit walk over to the Butterfly. 11