LCC 6310 Computation as an Expressive Medium Lecture 1.

Slides:



Advertisements
Similar presentations
Lesson One: The Beginning
Advertisements

Introduction to Programming
Processing Lecture. 1 What is processing?
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.
LAB SESSION 7 Graphical user interface Applet fundamentals Methods in applets Execution of an applet Graphics class.
Chapter 2 First Java Programs
Lesson One: The Beginning Chapter 2: Processing Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from built-in help reference.
Processing Processing is a simple programming environment that was created to make it easier to develop visually oriented applications with an emphasis.
IAT 334 Java using Processing ______________________________________________________________________________________ SCHOOL OF INTERACTIVE ARTS + TECHNOLOGY.
Faculty of Sciences and Social Sciences HOPE Structured Problem Solving Object Oriented Concepts 2 Stewart Blakeway FML 213
IAT 800 Foundations of Computational Art and Design Lecture 2.
DSA Processing. Links Processing.org My Processing page Ben Fry Ben Fry’s Thesis on Computational Information DesignThesis Casey Reas siteCasey Reas Casey.
IAT 800 Foundations of Computational Art and Design ______________________________________________________________________________________ SCHOOL OF INTERACTIVE.
Lesson One: The Beginning
Java: Chapter 1 Computer Systems Computer Programming II Aug
David Evans CS201j: Engineering Software University of Virginia Computer Science Lecture 18: 0xCAFEBABE (Java Byte Codes)
LESSON 2 CREATING A JAVA APPLICATION JAVA PROGRAMMING Compiled By: Edwin O. Okech [Tutor, Amoud University]
CSCI 273: Processing An Introduction. Programming Languages –An abstract "human understandable" language for telling the computer what to do –The abstract.
Java: Chapter 1 Computer Systems Computer Programming II.
CHAPTER 1 Overview of Programming and Problem Solving.
CS 106 Introduction to Computer Science I 01 / 25 / 2010 Instructor: Michael Eckmann.
Instructor: Tina Tian. About me Office: RLC 203A Office Hours: Wednesday 1:30 - 4:30 PM or .
Intro to Java & Processing. Review CS is about problem-solving CS is about problem-solving To write programs you must To write programs you must –Be able.
©Xiaoying Gao, Peter Andreae First Java Program COMP 102 #2 2014T2 Xiaoying Sharon Gao Computer Science Victoria University of Wellington.
Java Bytecode What is a.class file anyway? Dan Fleck George Mason University Fall 2007.
1 k Jarek Rossignac,  2008 Processing  Install Processing  Learn how to edit, run, save, export, post programs  Understand.
First Java Program COMP 102 #2 2015T2 Xiaoying Sharon Gao Computer Science Victoria University of Wellington.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 5 Working with Images Starting Out with Games & Graphics in.
CSCI Processing CSCI Introduction to Algorithm Design An Introduction.
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
______________________________________________________________________________________ SCHOOL OF INTERACTIVE ARTS + TECHNOLOGY [SIAT] |
Applets Applet is java program that can be embedded into HTML pages. Java applets runs on the java enabled web browsers such as mozilla and internet explorer.
Chapter 2: Color and Applets Coming up: Introduction to Graphics.
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 10 Fall 2010.
Chapter 2: A Brief History Object- Oriented Programming Presentation slides for Object-Oriented Programming by Yahya Garout KFUPM Information & Computer.
1 CSC 221: Computer Programming I Spring 2008 Objects and classes: a broad view  software objects, classes, object-oriented design  BlueJ IDE, compilation.
CSE S. Tanimoto Java Introduction 1 Java A Programming Language for Web-based Computing with Graphics.
C Language: Introduction
Introduction to Processing. 2 What is processing? A simple programming environment that was created to make it easier to develop visually oriented applications.
Loops & Graphics IP 10 Mr. Mellesmoen Recall Earlier we wrote a program listing numbers from 1 – 24 i=1 start: TextWindow.WriteLine(i) i=i+1 If.
1 Building Java Programs Supplement 3G: Graphics These lecture notes are copyright (C) Marty Stepp and Stuart Reges, They may not be rehosted, sold,
CSE S. Tanimoto Java Introduction 1 Java A Programming Language for Web-based Computing with Graphics.
SC Introduction to Programming Lecture 1: 5 th May 2003.
LCC 6310 Computation as an Expressive Medium Lecture 2.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Drawing pictures … It’s not art, it’s fun.
1 A Simple Applet. 2 Applets and applications An applet is a Java program that runs on a web page Applets can be run within any modern browser To run.
Lecture1 Instructor: Amal Hussain ALshardy. Introduce students to the basics of writing software programs including variables, types, arrays, control.
PyGame - Unit 1 PyGame Unit – – Introduction to PyGame.
ITP 109 Week 2 Trina Gregory Introduction to Java.
OCR A Level F453: The function and purpose of translators Translators a. describe the need for, and use of, translators to convert source code.
Creating Web Pages in Word. Sharing Office Files Online Many Web pages are created using the HTML programming language. Web page editors are software.
Introduction to Processing David Meredith Aalborg University Art &Technology, 3rd Semester Programming.
IAT 265 Multimedia Programming for Art and Design ______________________________________________________________________________________ SCHOOL OF INTERACTIVE.
Processing Introduction CSE 120 Spring 2017
CS216: Program and Data Representation
Chapter 2 First Java Programs
Example: Card Game Create a class called “Card”
LCC 6310 Computation as an Expressive Medium
Lesson One: The Beginning Chapter 1: Pixels Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from
Basic Graphics Drawing Shapes 1.
Processing and Drawing CSE 120 Winter 2018
Introduction to Algorithm Design
Lecture 7: Introduction to Processing
LCC 6310 Computation as an Expressive Medium
Lawrence Snyder University of Washington, Seattle
Processing Environment
LCC 6310 Computation as an Expressive Medium
IAT 800 Foundations of Computational Art and Design
Basic Processing … Drawing pictures … It’s not art, it’s fun
LCC 6310 Computation as an Expressive Medium
Presentation transcript:

LCC 6310 Computation as an Expressive Medium Lecture 1

Overview Go over the syllabus Go over the syllabus Brief introduction to me and my work Brief introduction to me and my work Art, programming and Java Art, programming and Java

Syllabus

Background Ph.D. in Computer Science Ph.D. in Computer Science Expressive AI: Artificial Intelligence-based art and entertainment Worked in industrial research labs (Intel, Tektronix) doing HCI research Worked in industrial research labs (Intel, Tektronix) doing HCI research Expressive AI: AI-based art and entertainment Expressive AI: AI-based art and entertainment

Some of my work Terminal Time – interactive video Façade – interactive drama Office Plant #1 – robotic sculpture

Some directions I’m someone to chat with about… I’m someone to chat with about… Interactive story (particularly procedural approaches) Robotic sculpture Video games (design, technology and culture) Director of the Experimental Game Lab Procedurally generative art

Introduce yourselves

Programming languages Abstract, “human understandable” language for telling computer what to do Abstract, “human understandable” language for telling computer what to do The abstract language must be translated into the low level language understood by the machine The abstract language must be translated into the low level language understood by the machine This translation is accomplished by an interpreter or compiler This translation is accomplished by an interpreter or compiler We will be learning the compiled language Java We will be learning the compiled language Java

A simple Java program for (int i = 0; i < 10; i++) { println(i); } Just prints the numbers 0 to 9 on the screen Human readable?!?

“Human readable” is relative Java compiler translates this into… for (int i = 0; i < 10; i++) { println(i); }

Java VM assembly code public static void main(java.lang.String[]); Code: 0: iconst_0 1: istore_1 2: goto 30 5: getstatic 8: new 11: dup 12: ldc 14: invokespecial #23 17: iload_1 18: invokevirtual #27 21: invokevirtual #31 24: invokevirtual #34 27: iinc 1, 1 30: iload_1 31: bipush 10 33: if_icmplt 5 36: return test.PrintLoop(); Code: 0: aload_0 1: invokespecial #43; 4: return

Object Oriented vs. Procedural Languages Procedural (e.g. C) We create some data representing an image (array of pixels to draw on the screen) We write a procedure than can be passed the image and will draw it Object Oriented (e.g. Java) We create a class that contains an image AND a routine draw it The data and the behavior (ability to draw) are in one "container"

A couple of Java’s relatives Smalltalk 80 Smalltalk 80 Alan Kay and the Dynabook (PARC) C++ C++ Managing big C programs: Bjarne Stroustrup

Java Designers started with C++ Designers started with C++ Smaller Simpler Safer Programming embedded systems Programming embedded systems Toasters, microwave ovens, TV set top boxes Reliability very important--avoid costly recalls Web programming Web programming Incorporated into web browsers at critical moment

The virtual machine Since Java was designed to run on embedded systems, it was designed around a virtual machine Since Java was designed to run on embedded systems, it was designed around a virtual machine “Write once, run everywhere” x86 Windows OS X G3/4/5 Processor Phone OS Java VM “Java OS” PCMacCell Phone Java Machine

But we’re using Processing Processing is built on top of Java Processing is built on top of Java Supports script-like coding Supports script-like coding Easy to get simple programs up fast But allows transition to full Java programming Has built-in methods and classes to make drawing easy Has built-in methods and classes to make drawing easy Easy to export program to applet Easy to export program to applet

Drawing in Processing Automatic creation of display window Automatic creation of display window Window has a coordinate system for drawing Window has a coordinate system for drawing x y

Let’s draw a point: point() point(x, y) – draws a point at the location x, y point(x, y) – draws a point at the location x, y Let’s try it: point(50, 50) Let’s try it: point(50, 50) Unexpected token: null – what the !?! Compiler errors appear in the bottom pane Compiler errors appear in the bottom pane All lines must be terminated with a semicolon ;

Drawing several points point(30, 20); point(85, 20); point(85, 75); point(30, 75);

Comments Comments are non-program text you put in the file to describe to others (and yourself) what you’re doing Comments are non-program text you put in the file to describe to others (and yourself) what you’re doing Important for being able to look back at your code and understand it Important for being able to look back at your code and understand it Single-line comments begin with // Single-line comments begin with // Multi-line comments begin with /* and end with */ Multi-line comments begin with /* and end with */ Commenting and uncommenting lines useful for figuring out code

Drawing shapes: some primitives line(x, y) line(x, y) triangle(x1, y1, x2, y2, x3, y3) triangle(x1, y1, x2, y2, x3, y3) rect(x, y, width, height) rect(x, y, width, height) rectMode() – CORNER, CENTER_DIAMETER, CORNERS elipse(x, y, width, height) elipse(x, y, width, height) ellipseMode() – CORNER, CENTER_DIAMETER, CORNERS, CENTER_RADIUS

Controlling color and line Colors represented as Red Green Blue (RGB) values Colors represented as Red Green Blue (RGB) values Each one ranges from 0 to 255 Can also use Hue Saturation Value (HSV) space, but we won’t worry about this for now background(R, G, B) – set the background color background(R, G, B) – set the background color stroke(R, G, B) – set the colors of the outline (default black) stroke(R, G, B) – set the colors of the outline (default black) noStroke() – no outline drawing around shapes fill(R, G, B) – set the fill color for shapes (default white) fill(R, G, B) – set the fill color for shapes (default white) noFill() – don’t fill the shapes (background shows through) strokeWeight(w) – line width for outlines (default 1) strokeWeight(w) – line width for outlines (default 1)

Playing around To learn how to program it is necessary to play around with code!!! To learn how to program it is necessary to play around with code!!! Don’t just wait for me to show you things Processing makes this easy Processing makes this easy Use the Reference in the Help menu Play with the examples

Saving your work You should install Processing on your own machine You should install Processing on your own machine Do this for Thursday Processing saves all projects in a default directory – no way to change it Processing saves all projects in a default directory – no way to change it This means that you should always copy your code to your local disk Don’t depend on your project remaining undisturbed on lab machines