Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fall 2007ACS-1805 Ron McFadyen1 Chapter 2 Creating Your First Animation (An Introduction to Programming)

Similar presentations


Presentation on theme: "Fall 2007ACS-1805 Ron McFadyen1 Chapter 2 Creating Your First Animation (An Introduction to Programming)"— Presentation transcript:

1 Fall 2007ACS-1805 Ron McFadyen1 Chapter 2 Creating Your First Animation (An Introduction to Programming)

2 Fall 2007ACS-1805 Ron McFadyen2 Creating an Animation Given the description of a story, game, simulation create an Alice animation

3 Fall 2007ACS-1805 Ron McFadyen3 Creating an Animation Recommended approach Read the scenario, Design an animation using storyboards, Implement your design Test your design If the animation is not correct repeat this process

4 Fall 2007ACS-1805 Ron McFadyen4 Example Read the “First Encounter” scenario: “After traveling through space, … Design From the scenario, determine the problem to be solved: What is the story to be told? What objects are required? What actions are needed? Use the storyboard technique to outline a solution Implementation Create an initial scene Translate the storyboard actions into code Test Determine if the implementation meets the requirements of the scenario See pages 20+

5 Fall 2007ACS-1805 Ron McFadyen5 Creating Your First Animation First Encounter scenario: After traveling through space, a robot-manned craft has just made a landing on a moon. The robot is on the moon and has set up a camera so earthbound scientists in Houston can view this historic event. The camera view shows the robot, the lunar Lander and some nearby rock formations. Suddenly an alien peeks out from behind a rock, surprising the robot. The robot looks around, spots the alien, and walks over to take a closer look. The alien is frightened and hides behind the rocks.

6 Fall 2007ACS-1805 Ron McFadyen6 Storyboards Two forms you might use: Visual hand-sketched screen captures Textual Algorithm Pseudocode

7 Fall 2007ACS-1805 Ron McFadyen7 Storyboards The text’s textual storyboard The above outlines an algorithm – a set of instructions to follow to accomplish a task The above is also referred to as pseudocode – it is very close to the program code generated by Alice 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

8 Fall 2007ACS-1805 Ron McFadyen8 Your First Program Implementing the design Select a world Choose your objects Create an initial scene Edit World.my first method create instructions using objects, methods, … See class demo Note how the animation is developed piece by piece - incrementally Do in order Do together If/Else Loop While For all in order For all together Wait Print // comments

9 Fall 2007ACS-1805 Ron McFadyen9 Your First Program Testing your implementation Play your world Observe the behaviour Is the behaviour what you expected? If yes … then you are done Otherwise … you have a bug and you need to Determine what needs to change Is the scenario correct? Is your design correct? Is your code correct? Make the changes and repeat this whole process again See class demo

10 Fall 2007ACS-1805 Ron McFadyen10 Point of View An object’s Point of View comprises its position and orientation. Position tells us where the object is in the world. Orientation tells us the direction an object is facing. An object’s position is given by 3 values: location in the world’s LR axis, location in the world’s FB axis, location in the world’s UD axis. See the pointOfView.position property values. An object’s orientation is given by 3 values: yaw, pitch, roll. Yaw is the objects rotation about the UD axis. Pitch is the object’s rotation about the LR axis. Roll is the object’s rotation about the FB axis. See The PointOfView property for objects

11 Fall 2007ACS-1805 Ron McFadyen11 Orientation of objects Each object has its own coordinate system that provides its own sense of direction If Bob is asked to turn left ¼ revolution, Bob’s sense of direction turns with him forward Bob Note here that Bob rotated on his up-down axis. An object’s yaw is how much the object is rotated along this up-down axis since its original position.

12 Fall 2007ACS-1805 Ron McFadyen12 Orientation of objects Bob had just turned… Now if we ask Bob to move forward, Bob advances along the forward-backward axis forward

13 Fall 2007ACS-1805 Ron McFadyen13 Orientation of objects Bob had moved forward… Now if we ask Bob to turn forward, Bob rotates on the left- right axis forward right Note here that Bob rotated on his left-right axis. An object’s pitch is how much the object is rotated along this left-right axis since its original position.

14 Fall 2007ACS-1805 Ron McFadyen14 Orientation of objects Consider Bob back at … Now if we ask Bob to roll left, Bob rotates on the forward- backward axis Note here that Bob rotated on his forward- backward axis. An object’s roll is how much the object is rotated along this forward-backward axis since its original position. forward

15 Fall 2007ACS-1805 Ron McFadyen15 Orientation of objects Each object has its own coordinate system that provides its own sense of direction If Dave and Peter are asked to move forward, they go in opposite directions You reset an object’s coordinate system by using orient to to give both the same sense of direction Dave orient to Peter forward Dave Peter

16 Fall 2007ACS-1805 Ron McFadyen16 Arguments Duration: the default length of time for an action is one second – this can be modified Style: the smoothness of an action is controlled using one of the values begin gently, begin abruptly, end gently, end abruptly As seen by: the sense of direction (orientation) for an action is by default determined by the object that is acting, but this can be changed by specifying a different object to use for direction


Download ppt "Fall 2007ACS-1805 Ron McFadyen1 Chapter 2 Creating Your First Animation (An Introduction to Programming)"

Similar presentations


Ads by Google