Fall 2008ACS-1805 Ron McFadyen1 ACS-1805 Introduction to Programming using Alice 2.0 Ron McFadyen...
-
date post
19-Dec-2015 -
Category
Documents
-
view
213 -
download
0
Transcript of Fall 2008ACS-1805 Ron McFadyen1 ACS-1805 Introduction to Programming using Alice 2.0 Ron McFadyen...
Fall 2008 ACS-1805 Ron McFadyen 1
ACS-1805
Introduction to Programming
using Alice 2.0
Ron McFadyenCourse Outline
Fall 2008 ACS-1805 Ron McFadyen 2
Alice 2.0, an introduction
• Alice 2.0 is a modern programming environment with:
• 3-D graphics
• 3-D models of objects
• Text: Learning to program with Alice; contains CD with software
• Latest version available at www.alice.org
• Originated, and development continues, at Carnegie Mellon University
• A similar environment, Panda3d, exists for the more advanced programmer. Pand3d was originally developed at Disney.
Fall 2008 ACS-1805 Ron McFadyen 3
Alice 3.0
• CMU and Electronic Arts are developing Alice 3.0 to provide objects from "The Sims" in a complete Java environment.
• 2008 (?)
2.0 vs 3.0
An aside (a point of interest)
Fall 2008 ACS-1805 Ron McFadyen 4
Alice 2.0• Virtual worlds
• Start a program by playing a virtual world
• Can play like a movie, or play like an interactive game
• Developing a world begins with a template (e.g. ground & sky)
• Objects
• Objects are added to the world (e.g. a person, a robot, a ball)
• Objects are chosen from a gallery of 3D models
• Object-oriented
• objects can do things – we send them messages commanding them to do what is necessary for an animation (e.g. move, turn, speak)
• Commands are contained in methods
• Event-driven
• User can interact with a world using the mouse or keyboard
Fall 2008 ACS-1805 Ron McFadyen 5
Alice 2.0
• Emphasizes programming fundamentals
• Programs are composed of methods
• Methods contain Alice instructions
• Objects are asked to do things they know how to do
• Events can trigger execution of program components
• Programs always run
• Alice has a smart editor with visual drag & drop (you tend to use the mouse more than the keyboard)
Fall 2008 ACS-1805 Ron McFadyen 6
Demo1: running an example
• Start Alice
• Load and run a world
• snowLove (from Examples worlds)
• Pause, Restart, Stop
Fall 2008 ACS-1805 Ron McFadyen 7
Demo2: create a world
• Create a new world
• File New
• Select the Templates tab
• Choose a template
• Later on… remember to save your world
Fall 2008 ACS-1805 Ron McFadyen 8
Demo2: Adding objects• Adding
objects• Click the
Add Objects button
• Click on Home, Local Gallery, Animals
• Click and drag an animal to the world
Fall 2008 ACS-1805 Ron McFadyen 9
Demo2: Adding objects• Manipulating
a scene• Use your
mouse to move objects about
• Move the camera to get a different angle
• Switch to quad view to more precisely move objects about
Fall 2008 ACS-1805 Ron McFadyen 10
Classes• Objects are categorized/organized into classes
• e.g. Frog
• An object is an instance of the class.
• e.g frog1, george, mary
Frog
frog1marygeorge
Fall 2008 ACS-1805 Ron McFadyen 11
Object Parts• Objects may be complex
• aliceLiddell has a rightArm
• The rightArm comprises a shoulder, and forearm, and the forearm has subparts too.
• A “+” means there are subparts that can be listed by clicking on the “+”
• A “-” means the subparts are listed. To suppress the listing of subparts click the “-”
• The picture on the right is showing the objects in a “tree” view
Fall 2008 ACS-1805 Ron McFadyen 12
Object Parts
aliceLiddell
rightArm leftArm neck lowerBody
shoulder forearm
hand
thumb
fingerTips
fingers
forearm
hand
thumb
fingerTips
fingers
shoulder
Consider the aliceLiddell object to the right. A computer scientist typically uses tree diagrams for complex hierarchical structures. Can you complete this for neck and lowerBody?
… …