Presentation on theme: "Introduction to Alice Alice is named in honor of Lewis Carroll’s Alice in Wonderland Modified by Serita Scott Further modified by Suzy Crowe."— Presentation transcript:
Introduction to Alice Alice is named in honor of Lewis Carroll’s Alice in Wonderland Modified by Serita Scott Further modified by Suzy Crowe
Alice A modern programming tool 3-D graphics 3-D models of objects Animation Objects can be made to move around the virtual world (a video game or simulation implemented in 3-D) Use the software from the CD Can download latest version from the web www.alice.org
Kinds of Animations Two kinds of animations: Movie Passive user watches the animation Interactive Active user clicks on mouse, types a key on keyboard … Actions of user are called events Load and run these example worlds: Amusement Park LakeSkater
Techniques and Tools Mouse is used to approximately position objects in the scene Camera Navigation is used to set the camera point of view Drop-down menu methods are used to resize objects more precisely position objects in the scene Quadview is used to position one object relative to another object
3 Dimensions, 6 Directions A 3D object has 3 dimensions height, width, depth 6 degrees of freedom directions of movement or orientation Need to know what the front of the object in order to determine what is forward movement.
Center of an object At the center of mass Where it stands on the ground Where it is held
Center of an object is used to determine : Position: the center of an object marks its position in the virtual world and is relative to the center of the ground. Distance measured from the object's center. In Alice, Objects have Animation The programmer is the director, directing the object’s behavior or actions. Alice then renders the animation.
Galleries Classes (3D models) are found in the galleries Local gallery (installed with the software) Minimum or complete options CD Gallery (only if CD is in the machine) Web gallery
Step 1: Specifications Decide on the story to tell, usually involves problem to be solved Examine and state what objects are needed and what is the role of each object in the story. Plan the behaviors or actions of the objects in the story. Alice calls this: Read a scenario.
Step 2: Design Design a solution, how the story will unfold. We will use a storyboard design technique, commonly used in the film industry
Demo Example The scenario or specification is: Hungry Penguin A lonely penguin is on a seemingly barren snowy landscape and very hungry. S/He looks around for something to eat. When movement catches penguin’s attention, the penguin walks toward it. It turns out to be a stranded fish. After catching the fish, the penguin shows off the fish to the camera, jumps up and down with glee, and swallows the fish. The challenge is: How can we create this animation?
Demo: Opening Alice 1.Drag the Alice folder from x:\Crowe\Alice to your desktop. 2.Double click on Alice. It will take a while. 3.While we are waiting for Alice to load, see if you can draw a picture story board of the scenario.
Creating a Storyboard There are 3 ways to create storyboards: Sketches Screen shots Text
Storyboard Option 2: Screen Shots Initial scene The spiderRobot walks toward the alien
Storyboard Option 3: Text Form A textual storyboard is like a "to-do" list. The Learning to Program in Alice textbook puts a textual storyboard in a box: Do the following steps in order alien moves up alien says "Slithy toves?" robot's head turns around robot turns to look at alien Do together robot moves toward the alien robot legs walk alien moves down Let’s prepare our Hungry Penguin textual story board.
You try it…. Let’s build the world for the Penguin Storyboard
Demo: Building A New World From Scratch 1.Select File New World 2.From the Templates tab that opened up choose SNOW Click Open or double click SNOW. 3.Find and click the green button (ADD OBJECTS) just below the world window. 4.Select: Animals. 5.Find and select: Class Fish. 6.Select: Add instance to world. 7.Find and select: Class Penguin 1.Examine how many body parts the penguin has. What do you think they are? Can we use the body parts for animation? 2.Look at some of the things the penguin can do. 8.Add an instance of the penguin to the world.
Saving a world Writing and testing an animation is an intense load on the computing system – a crash can occur. Recommendation: save your world every 15 minutes (Or at least every half hour) also save to a backup system (for example, a zip disk or memory key)
Getting Ready For Animation: Positioning Objects 1.Position the penguin in the lower right corner facing the left corner and the fish in the upper right corner. 2.From the ADD OBJECTS screen, it will be necessary to use the quad view or the tools below the the quad view options to: 1.Resize and then get the fish behind the penguin before positioning them 2.Resize fish again 3.position the penguin and fish. 3.In the Details window; 1.Select the fish from the Object Tree and examine all the things the fish can do in the methods tab 2.Look at the properties tab to see how attributes of an instance of a fish can be modified. 3.Select the penguin from the Object Tree and its methods tab in the Details window to examine what the penguin can do. 4.In the Object Tree select the + on the left of the penguin and look at all the body parts and the methods each one of them have. Look at the properties for each.
Penguin looks around for something to eat. What or method or methods of the penguin can we use to show this? Movement catches penguin’s attention. What fish method can we use to look a little like a fish struggling on land? How will the penguin respond to show something caught its attention? Penguin walks toward and catches the fish. Here we need a penguin movement, a fish movement and a fish property. Let’s see what they are. Penguin shows off the fish to the camera, jumps up and down with glee, and swallows the fish. We need a method that turns the penguin toward the camera. We need a method to have the penguin come toward the camera. Two functions bound by the Do Together structure will make the penguin jump up and down and flap its wings at the same time. A property of the fish will give the impression that it has been swallowed.
Storyboard: Text Form A textual storyboard is like a "to-do" list. Do the following steps in order penguin turns right penguin turns head left and then right fish in distance makes movement(roll) penguin’s head turns to look at movement Do together penguin turns to face fish penguin’s head turns to face fish penguin walks to fish fish moves to penguin’s beak penguin turns to face camera penguin walks toward camera Do together penguin jumps up and down penguin flaps wings penguin swallows fish( finsh isShowing set to false)
Enhancements How can we make the animation look more real or natural? Here are some of the things I did to enhance the automation. Can you think of others? 1.Have the penguins head turn to face the fish first, then the whole penguin turn to face the fish and the head turn to face the fish again. Why the last part? 2.Speed up the walking pace of the penguin. 3.Have the penguin lean over to get the fish, and come back to the original position.
Step 2: Implementation To implement the storyboard, translate the actions in the storyboard to a program. Program (a.k.a. script) a list of instructions to have the objects perform certain actions in the animation
Action Blocks in Alice Sequential Action Block – actions occur one after another Simultaneous Action Block -- actions occur at the same time
Concepts in this first program Program instructions may have arguments Example: for the move instruction, the arguments we used in this example were direction distance duration DoTogether and DoInOrder blocks can be nested one inside the other
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, a particular combination of the instructions may perform an action that is not immediately obvious. Comments are used to document the code – explain the purpose of a particular segment of the program to the human reader.
Demo Hungry Penguin with Comments Comments in this example world illustrate description of the action performed by the entire method description of the purpose of a small segment of code
Alice Tutorials Open Alice and work through tutorials 1 and 2 Then begin looking at worlds and objects for your story board