Four simple expressions in meta. Data objects Pieces of data in a computer are called objects Today, we’ll talk about four kinds of objects Numbers Pictures.

Slides:



Advertisements
Similar presentations
Working with images and scenes CS 5010 Program Design Paradigms “Bootcamp” Lesson 2.5 TexPoint fonts used in EMF. Read the TexPoint manual before you delete.
Advertisements

PHY-102 SAPIntroductory GraphicsSlide 1 Introductory Graphics In this section we will learn how about how to draw graphics on the screen in Java:  Drawing.
INTRODUCTION TO HYPERTEXT MARKUP LANGUAGE 1. Outline  Introduction  Markup Languages  Editing HTML  Common Tags  Headers  Text Styling  Linking.
Three types, subtypes, and inheritance. The story up until now Everything in your computer is data Including programs Data is divided into objects Objects.
GUI and Swing, part 2 The illustrated edition. Scroll bars As we have previously seen, a JTextArea has a fixed size, but the amount of text that can be.
Thirteen recursion. Recursion ► [define horizontal-array [object spacing count → [if [= count 1] object [group object [translate [point spacing 0] [horizontal-array.
Six compound procedures and higher-order procedures.
Four simple expressions in meta. Data objects Pieces of data in a computer are called objects Today, we’ll talk about four kinds of objects Numbers Pictures.
Copyright 2008 by Pearson Education Building Java Programs Graphics Reading: Supplement 3G.
Twenty high-level operations on pictures. Recap: vector graphics constructors [box width height] Creates a picture with a box [group pictures …] Makes.
1 Applets Chapter 1 To understand:  why applets are used to extend the capabilities of Web pages  how an applet is executed and know about the restrictions.
Fifteen high-level operations on pictures. Recap: vector graphics constructors [box width height] Creates a picture with a box [group pictures …] Makes.
CSC 160 Computer Programming for Non-Majors Lecture #3c: Working with Pictures (continued) Prof. Adam M. Wittenstein
Seven constructing simple procedures using abstraction.
A Simple Applet. Applets and applications An applet is a Java program that runs on a web page –Applets can be run from: Internet Explorer Netscape Navigator.
Copyright 2006 by Pearson Education 1 Building Java Programs Supplement 3G: Graphics.
A Simple Applet.
Six compound procedures and higher-order procedures.
2.4: Rotations.
1 Interface Types & Polymorphism & introduction to graphics programming in Java.
ITP 104.  While you can do things like this:  Better to use styles instead:
Chapter 4: Hypertext Markup Language Primer TECH Prof. Jeff Cheng.
Graphics and Procedures Programming Right from the Start with Visual Basic.NET 1/e 5.
> 1 Diagrams in Word Faculty of Health Alan Grace.
Element. The element Used to dynamically draw graphics using javascript. Capable of drawing paths, circles, rectangles, text, and images.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 7 The Game Loop and Animation Starting Out with Games & Graphics.
Image Representation. Objectives  Bitmaps: resolution, colour depth and simple bitmap file calculations.  Vector graphics: drawing list – objects and.
Programming in Processing Taught by Ms. Madsen Assistants: Ms. Fischer and Ms. Yen Winsor School, 2/6/08.
Lecture 15: Intro to Graphics Yoni Fridman 7/25/01 7/25/01.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 2 Graphics Programming with C++ and the Dark GDK Library Starting.
Sketching & Drawing Projects
Graphic Basics in C ATS 315. The Graphics Window Will look something like this.
Tkinter Canvas.
College of Micronesia- FSM Pohnpei State Campus GEORGE S. MANGONON, MBA Chair, Math/Sci Division September 15-25, 2008.
Computer Science 101 Lists and Tables. Lists Unordered lists - use a bullet Ordered lists - use a number, Roman numeral, or letter.
Digital Media Dr. Jim Rowan ITEC So far… We have compared bitmapped graphics and vector graphics We have discussed bitmapped images, some file formats.
CSC 1051 – Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website:
CPSC 217 T03 Week II Part #1: SimpleGraphics.py Hubert (Sathaporn) Hu.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Drawing pictures … It’s not art, it’s fun.
CRE Programming Club - Class 5 Robert Eckstein and Robert Heard.
1 Introduction to Graphics b The last one or two sections of each chapter of the textbook focus on graphical issues b Most computer programs have graphical.
Digital Media Lecture 5: Vector Graphics Georgia Gwinnett College School of Science and Technology Dr. Jim Rowan.
CSC 1051 – Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website:
PyGame - Unit 1 PyGame Unit – – Introduction to PyGame.
CS 115 Lecture 6 Graphics Taken from notes by Dr. Neil Moore.
CompSci 4 Java 4 Apr 14, 2009 Prof. Susan Rodger.
AP CSP: Pixelation – B&W/Color Images
Some of Chap 17.
Pixels, Colors and Shapes
Adapted from slides by Marty Stepp and Stuart Reges
high-level operations on pictures
Building Java Programs
constructing simple procedures using abstraction
Building Java Programs
CSc 110, Spring 2017 Lecture 6: Parameters (cont.) and Graphics
Word Lesson 6 Working with Graphics
ISC440: Web Programming II Ch14: HTML5 Canvas
Exercise 28 - Skills Vector tools enable you to create perfectly formed shapes and lines of all sorts. What’s more the vector objects keep their shape.
Building Java Programs
CSc 110, Spring 2018 Lecture 9: Parameters, Graphics and Random
SSEA Computer Science: Track A
A movement of a figure in a plane.
Using Logo and Logic This presentation uses a version of Logo called StarLogo available through MIT. It can be downloaded for free and installed on your.
Building Java Programs
Building Java Programs
Lawrence Snyder University of Washington, Seattle
Building Java Programs
Building Java Programs
Graphics Reading: Supplement 3G
Working with images and scenes
Presentation transcript:

four simple expressions in meta

Data objects Pieces of data in a computer are called objects Today, we’ll talk about four kinds of objects Numbers Pictures (images) Points (positions within an image) Procedures (programs) Take a set of objects as inputs (arguments) Return another object as a result Procedures are the most important kind of data in computer science

Referring expressions in meta Names (‘robin’, ‘rob’, ‘+’, ‘point’) Aka “variables” Refer directly to objects Constants (fixed names) Numbers Refer to fixed objects (the numbers) Strings “Arbitrary text enclosed in double-quotes” Also refer to fixed objects (the text) Functional expressions Sequences of expressions Separated by spaces (or line breaks) Enclosed in square brackets First expression has to refer to a procedure Example: [point ]

Some functional expressions [box width height] A picture of a box with the specified width and height (which must be numbers) [ellipse width height] Same, but gives you a curved object instead of a box [line point point] A line with the specified endpoints [point number number] A point with the specified coordinates

Rectangles [box width height] Creates a rectangle Centered at (0,0) Width is width Height is height Default coloring Unfilled (interior is left alone) Border drawn in black (which shows up very poorly in these slides) ► [box ] ►

hey stupid don’t you think it’s time you did an example?

Circles and ellipses [ellipse width height] Same, but curved If width and height are the same, you get a circle Otherwise, an ellipse ► [ellipse ] ► [ellipse ]

Lines [line start end] Makes a line from start to end Start and end are point objects Created using [point x y] Note that: Default is black line 1 pixel wide ► [line [point 0 0] [point ]] ►

Coordinate system Positions on the screen described by (x, y) coordinates X: number of pixels to the right of the “origin” Y: number of pixels down from the “origin” Coordinates can be negative (system just shifts the image to make them visible) (0,0) (100, 33) (33, 100)

Groups [group object object …] Make a composite picture from multiple picture objects Objects can be shapes or other groups ► [group [box ] [box ] [box ] [ellipse ]] ►

hey how about another example?

Translate [translate point object object …] Shifts objects so that their (0,0) is now at point Shifting by [point 10 20] moves everything Right 10 pixels Down 20 pixels Also acts like a group, so you can include multiple objects and they’re all shifted ► [group [box ] [translate [point 50 0] [box ]]] ►

hey show them how to handle errors

that’s everything you need to know for the assignment but here’s some other stuff you might have fun with

Scaling [scale scale-factor object object …] Make a composite object from multiple picture objects Also acts like a group, so you can include multiple objects and they’re all scaled ► [box ] ► [scale 2 [box ] [box 10 10]] ►

Rotate [rotate angle object object …] Rotates contents clockwise angle degrees about the point (0,0) Also acts like a group, so you can include multiple objects and they’re all rotated around (0,0) ► [rotate 45 [box ]] ►

Paint [paint color objects …] Fills interiors of objects with color, which can be A color object made with [color red green blue] A string (magic color name) A symbol (magic color name) The word: null (no quotes) Turns off filling Also acts like a group, so you can include multiple objects ► [group [box ] [paint “black” [box ]]] ►

Ink [ink pen objects …] [pen color width] Draws the outline of objects with specified pen Pen specifies color and width of line Pen objects can be created with the pen procedure … or you can just specify a color in lieu of a pen Also acts like a group, so you can include multiple objects ► [group [box ] [ink [pen “black” 10] [box ]]] ►

Peeking inside the data Objects are like web pages Pages can contain links to other pages Different from containing the pages themselves But I can in some sense pass you a whole set of pages by passing you a link to a single page that has links to the others Forming a group is like making a new web page with links to the component objects You can think of the components as “in” the group Or just as “available to” the group group ellipsebox

Data as hierarchy When we group objects inside groups inside other groups We get a tree- structured hierarchy Kind of like outlines And kind of like code group translatebox group translatebox group translatebox note: translate doesn’t actually change its arguments – it makes a translate object

Using the Studio Meta is installed on all Studio PCs Log in using your NetID and normal NetID password The Studio will be staffed most nights with people to help you A schedule will be posted shortly You can get a key from the Louis Hall cage (see yesterday’s )

For Wednesday Download programming exercise 1 from the syllabus page: AnimateArts/AA1 Follow the instructions