introduction to csci 1 n.
Skip this Video
Loading SlideShow in 5 Seconds..
Introduction to CSCI 1 PowerPoint Presentation
Download Presentation
Introduction to CSCI 1

Introduction to CSCI 1

338 Vues Download Presentation
Télécharger la présentation

Introduction to CSCI 1

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Introduction to CSCI 1

  2. How this class will work •

  3. 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)

  4. The basics of programming • A computer program is a set of instructions that tell the computer what to do • It is important to write your programs in an “elegant” fashion. • Huh? • Two primary functions: • To tell the computer what to do • To tell other humans what you want the computer to do

  5. Elegant programs • A program is elegant if other humans can easily understand and appreciate the intentions of the original programmer. • Your goal should be to make your program easy to read, even by someone not a programmer • Should not require any head scratching

  6. Programs composed from simple ideas • A list of instructions like a recipe • Ifs (e.g., if it is raining, take an umbrella) • Repeating behavior (e.g., while there are cookies on your plate, keeping eating cookies) usually called looping or iteration • Breaking things up into smaller pieces • Compute a result

  7. Simple ideas, cont’d • Programming is just using these ideas in various combinations • Most computers understand only about 100 distinct instructions • The millions of programs that run on a computer use these instructions in different orders and combinations • Like chess in this way

  8. Alice concepts

  9. Concept: Virtual world • Video game or simulation implemented in 3D 2D vs. 3D

  10. Virtual world, cont’d • Virtual worlds provide an environment that allow us to simulate the type of interactions with which we are familiar in the real world.

  11. Concept: Object • An "object" is • any thing that can be identified as unique from other things • How is an object unique? • has a name • has properties: • width, height, color, location • can perform actions (methods): • associated actions it can perform • tasks it can carry out

  12. Object Parts • Objects may be composed of parts

  13. 3D models • In Alice, nearly all objects are represented by 3D models • These are the animals, people, cars, anvils, etc. that you add to a world • 3D models are found in the Alice galleries • Alice is not a 3D graphics drawing program • With the exception of he-builder and she-builder we use pre-defined models

  14. Concept: 3 Dimensions, 6 Directions • A 3D object has • 3 dimensions • height, width, depth • 6 degrees of freedom (directions of movement)

  15. Concept: Center of an object • At the center of mass • Where it stands on the ground • Where it is held • Distance between objects is measured from their centers • An object’s position in the world is given by its center

  16. peter Person paul mary spike Dogs scottie fluffy Class • Objects are categorized into classes • Each object is an instance of the class. • All objects in a class have similar propertiesand generally can perform the same tasks.

  17. Appendix A: Exploring Alice • World 1:Open World…Week1AppendixA_FirstWorld.a2w • Play

  18. Appendix A: exploring Alice • Notice the Object Tree contains all of the objects in the world. • The camera and the light are in every Alice word.

  19. Object Parts: A closer look

  20. Introduction to the "code" • Look at Hare in the Object tree • Expand to find the hare's ears • Notice that the hare's left ear moves forward and back in this animation. • Let's modify this animation

  21. Modifying code • Let's change the movement to go left and right instead of forward and backward. • PLAY

  22. Modifying code • Let’s make the RIGHT ear move.

  23. Modifying code • Finally • Let's change this one last time so that the RIGHT ear moves forward and back. • PLAY

  24. Interactive World • Open New World • Open AppendixA_DancingBee.a2w • Play • Press Up-Arrow key • Press space bar

  25. Two types of worlds • Movie World • movie runs from beginning to end • Interactive World • you choose how animation runs (events)

  26. Creating your own world • File menuNew World • grass template • Save World As MyFirstTry • Navigate to the appropriate folder

  27. Creating your own world • Add Objects • Search Gallery allows you to choose objects Click Folder

  28. Objects • An "object" is • any thing that can be identified as unique from other things • How is an object unique? • has a name • has properties: • width, height, color, location • can perform actions (methods): • associated actions it can perform • tasks it can carry out

  29. Galleries • Classes (3D models) are found in the galleries • Local gallery (installed with the software) • Minimum or complete options • Web gallery

  30. Choose Local Gallery • PeopleAdd • snowMan (2 ways to add to world) • Drag snowman to world • Click and Add Instance to world • snowWoman

  31. Click on snowman and experiment with controls. Click on snowWoman and check "affectparts" delete her hat. Controls

  32. Controls

  33. Camera Top Side Front Controls

  34. Moving the camera changes the view of the world Go slowly. More controls

  35. New worlds • Add all objects when you create the world. • Use mouse and camera controls to arrange objects at the scene.

  36. Assignment • Read (before the next class session) Chapter 1 • Section 1, Introduction to Alice • Section 2, Alice Concepts • Tips & Techniques 1, Special Effects

  37. Object-oriented programming and Alice • In designing modern software we work from an algorithm. • An algorithm is a plan for solving a problem by following a sequence of steps • To help manage the growing complexity of software, computer scientists introduced the concept of OOP some time ago

  38. OOP • An object can be something in the physical world or just an abstract idea • Airplane (auto-pilot program) • A bank transaction (ATM software) • The code that manipulate the properties of an object are called the object’s methods • We can think of an object as a collection of its properties and methods • The values stored in the properties of an object are called collectively know as the object’s state • OOP algorithms define interactions between objects • An OO program uses objects as tools to do its work

  39. Exploring the Alice Interface • Alice is an example of an Integrated Development Environment (IDE) • An IDE is a computer program used to write other computer programs • The Alice IDE is often called the Alice interface

  40. Welcome to Alice! dialog

  41. Tutorials tab

  42. Recent worlds tab

  43. Examples tab

  44. Open a world tab Navigation Folders Files Controls

  45. World Window Events Area Object Tree Details Area Editor Area

  46. Object Tree

  47. Details Area

  48. Editor Area

  49. Events Area

  50. event trigger event handler event handler event handler