Napredna 3D računalniška grafika in vizualizacije 2. stopnja, magistrskega študija GIK
|
|
- Donald Mason
- 5 years ago
- Views:
Transcription
1 Napredna 3D računalniška grafika in vizualizacije 2. stopnja, magistrskega študija GIK Helena Gabrijelčič Tomc (UL, NTF, Oddelek za tekstilstvo, grafiko in oblikovanje)
2 Processing
3 Processing Processing je odprtokodna fleksibilna programska skicirka in jezik, ki omogoča kodiranje v kontekstu vizualne umetnosti. "Processing is open-source a flexible software sketchbook and a language for learning how to code within the context of the visual arts" Processing foundation "Our mission is to promote software literacy within the visual arts, and visual literacy within technologyrelated fields and to make these fields accessible to diverse communities."
4 Uvod / Introduction
5
6 Java programski jezik Java je objektno usmerjeni, prenosljivi programski jezik "Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented"
7 Delovno okolje veter/ Working environment
8 Kodiranje/Coding veter običajni začetki kodiranja z definicijo velikosti površine / common beginnings of coding with size definition size() size(480, 120)
9 Risanje/Drawing sile po poti, gravitacija točka / point size(100, 100); point(50,50); point(53,53); point(56,56); point(59,59); elipsa / ellipse ellipse(50, 50, 80, 80);
10 Interaktivni krogi / Interactive circles void setup() { size(650, 650); void draw() { if (mousepressed) { fill(0); else { fill(255); ellipse(mousex, mousey, 80, 80); void setup() {
11 eksplozija Linije in trikotniki / Lines and triangles size(200,400); line(50,50,150,150); line(50,250,150,350); line(50,250,150,150); size(500,500); triangle(250,100,100,300,400,450);
12 eksplozija Večkotniki, krogle in loki / Polygons, circles and arcs size(500,500); rect(100,100,200,200); ellipse(350,350,200,100); size(500,500); arc(250,250,200,200, 0, HALF_PI); size(500,500); arc(250,250,200,200, PI, TWO_PI+HALF_PI); size(500,500); arc(250,250,200,200, QUARTER_PI, PI+QUARTER_PI);
13 Zaporedje risanja in lastnosti / Order of drawing and properties size(500, 500); triangle(250,100,100,300,400,450); ellipse(350,350,200,100); size(500, 500); ellipse(350,350,200,100); triangle(250,100,100,300,40 0,450); size(500, 500); smooth(); triangle(250,100,100,300,400,450); strokeweight(8); ellipse(350,350,200,100); strokeweight(25);
14 Sivine, barve in transparence / Grayscale, colors and transparency size(500, 500); nostroke(); smooth(); background(50); fill(255, 160); rect(150, 150, 200, 200); fill(0, 150, 0, 200); rect(200, 300, 200, 200); fill(0, 0, 100, 75); ellipse(350, 125, 100, 200);
15 Spremenljivke / Variables
16 Pomen spremenljivk / Meaning of variables Spremenljivke shranjujejo vrednosti v spominu z namenom kasnejše uporabe v programu. Variables store the values in the memory in order to use these values in the further program.
17 Spremenljivke / Variables size(500, 250); smooth(); int y=75; int a=100; rect(50,y,a,a); rect(150,y,a,a); rect(250,y,a,a); rect(350,y,a,a); size(500, 250); smooth(); int y=25; int a=75; rect(50,y,a,a); rect(150,y,a,a); rect(250,y,a,a); rect(350,y,a,a);
18 Operatorji/Operators Operatorji so aritmetične matematične funkcije vsote +, razlike -, množenja *, deljenja / ter enačaja =. Operators are aritmetic mathematical functions +, -, *, / and =. size(500, 250); int x = 50; int h = 40; int y = 75; ellipse(x, y, 100, h); x = x + 200; ellipse (x, y + h, 100, h); x = x + 200; ellipse (x, y + h*2, 100, h); > večji od / greater than < manjši od / less than >= večji ali enak / greater than or equal to <= manjši ali enak / less than or equal to == enak kot / equal to!= ni enak kot / not equal to
19 Ponavljanja in for zanke / Repetitions and for loops size(525, 250); smooth(); strokeweight(5); rect(25, 50, 70, 70); rect (125, 50, 70, 70); rect (225, 50, 70, 70); rect (325, 50, 70, 70); rect (425, 50, 70, 70); for zanka / for loop size(525, 250); smooth(); strokeweight(5); for(int i=25;i<475;i+=100) { rect(i,50,70, 70); blok / blocks
20 For zanke in struktura / For loops and their structure Struktura kode je sestavljena in iniciacije (ang. inicialization, init), testa (ang. test) ter posodabljanja (ang. update), tako kot prikazujejo spodnje vrstice. The statement is composed of initialization (init), the test, and the update: for (init; test; update) { statements Getting started with Processing: Casey Reas, Ben Fry
21 Odziv / Response
22 Odziv / Response v konzoli urejevalnika programa Processing se izpisuje "Jaz pišem", dokler ne zapremo okna ali pritisnemo gumb Stop. Vsako dejanje draw() se imenuje okno ali slika (frame). Println() je fukncija, ki izpisuje tekst, framecount pa je posebna spremenljivka zaporedij (1, 2, 3, ) In the programmes console the sentence "Jaz pišem" is written until the window is not closed or we press the buttom Stop. Each action draw() is called a frame, Println() is a function that writes text and framecount is a special variable of a sequence (1, 2, 3, ). void draw() { println("jaz pišem"); println(framecount);
23 Funkcija Setup / Setup function 1. spremenljivka je določena izven setup() ali draw() / variable is defined out of setup() or draw() 2. koda znotraj setup() je pognana enkrat / the code inside setup() is driven once 3. koda znotraj draw() je pognana neprekinjeno / the code inside draw () is driven continuously int x = 340; int y = -70; int diameter = 420; void setup() { size(500, 175); smooth(); fill(150); void draw() { background(230); ellipse(x, y, diameter, diameter);
24 Sledenje / Follow Ko imamo enkrat določeno kontinuirnost, lahko določimo slednje z miško When the continuity is setted it can be defined with the mouse void setup() { size(500, 175); fill(20, 175); smooth(); nostroke(); void draw() { rect(mousex, mousey, 15, 15);
25 Odziv na klikanje / Response on clicking void setup() { size(500, 175); smooth(); strokeweight(20); void draw() { background(50); stroke(210); line(40, 0, 70, height); if (mousepressed == true) { stroke(25); line(0, 70, width, 50); if (test) { statements
26 Struktura if else / if else structure
27 Pisanje črk, besedila / Fonts writting, text void setup() { size(120, 120); textsize(64); textalign(center); void draw() { background(0); char c = 'A'; if (keypressed) { text(c, 60, 80);
28 Medji / Media
29 Slike / Images Processing uporablja mapo data, kjer shranjuje medije kot so rastrske slike (.jpg,.gif,.png), ilustracije, vektorske slike. Mapo data dobimo v meniju Sketch, izberemo Add file, datoteka je pri nalaganju avtomatično naložena v mapo Data. Processing uses folder data, where media is stored (.jpg,.gif,.png), illustration, vector images. Folder data is in the meni Sketch, where we select Add file, the file is by the uploading automatically saved in folder Data. 1. sliko naložimo v mapo Data, kot je bilo predstavljeno v predhodnih stavkih, 2. ustvarimo spremenljivko PImage, kjer bo slika shranjena 3. naložimo sliko v spremenljivko z ukazom loadimage() 1. appload the image in the folder data 2. create a PImage variable (this is storing the image) 3. the image is then load into the variable with loadimage()
30 Slike / Images PImage img; void setup() { size(700, 467); img = loadimage("flower-life.jpg"); void draw() { image(img, 0, 0); PImage img; void setup() { size(700, 500); img = loadimage("flower-life.jpg"); void draw() { background(0); image(img, 0, 0, mousex, mousey);
31 Črke / Typography Fonte ustvarimo z ukazi Tools (glavni meni) ter Create font. Kjer izberemo želeni font in njegove velikosti. S klikom na OK se font ustvari v mapi Data kot format.vlw Fonts are created with Tools (main meni) and Create font. We can define size and properties. In folder Data.vlw format is cerated
32 Črke / Typography PFont font; void setup() { size(500, 250); smooth(); font = loadfont("arialmt-48.vlw"); textfont(font); void draw() { background(75); textsize(40); text("danes je prečudovit dan...", 35, 100); textsize(22); text("danes je prečudovit dan...", 35, 170);
33 Skladiščene besedila v nizu String / Storing of text in String PFont font; String quote = "Danes je prečudvit dan "; void setup() { size(500, 350); font = loadfont("arialmt-48.vlw"); textfont(font); void draw() { background(75); textsize(48); text(quote, 26, 30, 250, 250); textsize(30); text(quote, 26, 270, 250, 500);
34 Gibanje / Motion
35 Gibanje / Motion Processing privzeto poganja 60 slik na sekundo ter omogoča gibanje z ukazi Processing (by default) drives 60 iamges per second and defines motion void draw() { println(framerate);
36 Gibanje / Motion int radius = 80; float x = -radius; float speed = 1; void setup() { size(500, 250); smooth(); ellipsemode(radius); void draw() { background(0); x += speed; // poveča vrednost x arc(x, 60, radius, radius, 1, 5);
37 Interpolacija / Interpolation, tweening interpolacijo med dvema ključnima sličicama se določa tako da pred glavno kodo določimo skupino spremenljivk, ki bodo ustrezne prehode omogočale, kot prikazuje spodnja koda interpolation between two images is defined with the group of variables that enable the occurance of the interpolation int startx = 20; // začetna koordinata x int stopx = 420; // končna koordinata x int starty = 30; // začetna koordinata y int stopy = 180; // končna koordinata y float x = startx; // trenutna koordinata x float y = starty; // trenutna koordinata y float step = 0.009; // velikost vsakega koraka (0.0 to 1.0) float pct = 0.0; // procent potovanja (0.0 to 1.0) void setup() { size(500, 250); smooth(); void draw() { background(0); if (pct < 1.0) { x = startx + ((stopx-startx) * pct); y = starty + ((stopy-startx) * pct); pct += step; ellipse(x, y, 50, 50);
38 Naključnost / Randomness funkcije sin() and cos() vrnejo vrednosti med 1 in 1 za določene vrednosti kotov teh dveh funkcij functions sin() and cos() give back values between -1 and 1 for various values of angles of these functions float angle = 0.0; void draw() { float sinval = sin(angle); println(sinval); float gray = map(sinval, -1, 1, 0, 255); background(gray); angle += 0.1;
39 Spremembe: Premiki / Transformations: Translations transformacije lahko osamimo tako da ne vplivajo na nadaljnje ukaze; s tem namenom uporabimo funkcije pushmatrix() in popmatrix(); funkcija pushmatrix() shrani kopijo trenutnih koordinat, medtem ko funkcija popmatrix() resetira sistem transformations can be isolated so that they are not influencing on further statements; we use functions pushmatrix() and popmatrix(); function pushmatrix() saves the copy of actual coordinates, meanwhile function popmatrix() resets the system void setup() { size(250, 250); void draw() { translate(mousex, mousey); rect(0, 0, 50, 50); translate(45, 35); rect(0, 0, 25, 25); void setup() { size(250, 250); void draw() { pushmatrix(); translate(mousex, mousey); rect(0, 0, 50, 50); popmatrix(); translate(45, 35); rect(0, 0, 25, 25);
40 Spremembe: Rotacije in skaliranje / Transformations: Rotations, scaling float angle = 0.0; void setup() { size(250, 250); smooth(); void draw() { translate(mousex, mousey); rotate(angle); rect(-15, -15, 50, 50); angle += 0.1; float angle = 0.0; void setup() { size(400, 400); smooth(); void draw() { translate(mousex, mousey); scale(sin(angle) + 2); rect(-15, -15, 50, 50); angle += 0.1;
41 Funkcije / Functions
42 Trki, kolizija (Collision) Funkcije / Functions funkcije so osnovni gradniki Processing kode, ki so medseboj neodvisni zato se lahko modularno sestavljajo; funkcije so tako size(), line(), fill() functions are basic elements of Processing code that are not coindependent, consequently they can be modularly composed; functions are size(), line(), fill()
43 void setup() { size(480, 120); smooth(); void draw() { background(204); owl(110, 110); owl(180, 110); void owl(int x, int y) { pushmatrix(); translate(x, y); stroke(0); strokeweight(70); line(0, -35, 0, -65); // telo nostroke(); fill(255); ellipse(-17.5, -65, 35, 35); // podr. levega očesa ellipse(17.5, -65, 35, 35); // podr. desnega očesa arc(0, -65, 70, 70, 0, PI); // brada fill(0); ellipse(-14, -65, 8, 8); // levo oko ellipse(14, -65, 8, 8); // desno oko quad(0, -58, 4, -51, 0, -44, -4, -51); // kljun popmatrix(); void setup() { size(480, 120); smooth(); void draw() { background(204); for (int x = 35; x < width + 70; x += 70) { owl(x, 110); void owl(int x, int y) { pushmatrix(); translate(x, y); stroke(0); strokeweight(70); line(0, -35, 0, -65); // Body nostroke(); fill(255); ellipse(-17.5, -65, 35, 35); // podr. levega očesa ellipse(17.5, -65, 35, 35); // podr. desnega očesa arc(0, -65, 70, 70, 0, PI); // brada fill(0); ellipse(-14, -65, 8, 8); // levo oko ellipse(14, -65, 8, 8); // desno oko quad(0, -58, 4, -51, 0, -44, -4, -51); // kljun popmatrix();
44 Objekti / Objects
45 Trki, kolizija (Collision) Objekti / Objects Objekti so kolekcije spremenljivk in funkcij, ki so v določeni odvisnosti. V kontekstu objektov je spremenljivka imenovana polje (ang. field) ali spremenljivka primera (ang. instance variable) medtem ko je funkcija imenovana metoda (ang. method). Objects are the collections of variables and functions that are in some relationship; in the context of the object the variable is called field or instance variable and the function is called method Objekti in razredi (ang. objects and classes) Razred je specifikacija objekta, torej kot nek načrt objekta. Tako kot objekti, razredi definirajo tipe podatkov in obnašanje, a vsak objet ki je iz določenega razreda ima spremenljivke, ki imajo lahko različne vrednosti. Class is a specification of an object, as the plan of an object. As objects so classes define data type and their behaviour; each object that is from one class has its variables that have different values
46 Objekti / Objects Postopek poteka v štirih korakih: 1. ustvarjanje bloka (ang. block) 2. dodajanje polij (ang. fields) 3. pisanje konstruktorja (ang. constructor), ki dodeli vrednost polju 4. dodajanje metode. ustvarjanje bloka / block creating dodajanje polij preko konstruktorja / adding the fileds with the cinstructor pisanje konstruktorja / writing the constructor dodajanje metode / adding the method class JitterBug { float x; float y; int diameter; float speed = 0.5; JitterBug(float tempx, float tempy, int tempdiameter) { x = tempx; y = tempy; diameter = tempdiameter; void move() { x += random(-speed, speed); y += random(-speed, speed); void display() { ellipse(x, y, diameter, diameter);
47 Zbirke / Arrays
48 Trki, kolizija (Collision) Zbirke / Arrays Zbirke so seznami spremenljivk, ki delijo isto ime. Zbirke so uporabne, saj lahko ustvarjamo z več spremenljivkami brez da bi določevali nova imena za vsako od spremenljivk. To omogoča krajšo in optimalnejšo kodo. Arrays are the group of elements that share the same name. They are very useful, due to the ability of working with various variables without changing the names of these variables. Consequently, the code is optimised. Vsak del v zbirki se imenuje element (ang. element) ter vsak od teh elementov ima indeks vrednost (ang. index value), ki omogoča določanje pozicije znotraj zbirke. Each part of the Array is called element and each element has its own index value that defines the position inside of the Array.
49 Zbirke / Arrays Spremenljivko lahko ustvarimo z / Variable is defined with: int x; Zbirko pa le tako da dodamo oglate klepaje / Array is defined with: int[] x; Če tako želimo narediti 5000 spremenljivk / 5000 variables are created with: int[] x = new int[5000];
50 Zbirke / Arrays Delo z zbirkami vključuje tri korake / Working with Arrays includes: 1. deklaracija zbirke ter definicija tipa podatkov / Array declaration and definition of data type; 2. ustvarjanje zbirke s ključno besedo new ter definicija dolžine / creation of Array with the word new and definition of its length; 3. dodeljevanje vrednosti vsakemu elementu / definition of the values to each element. Spodaj so predstavljeni trije različni načini določevanja in dodeljevanja zbirke, ki pa imajo enak rezultat: int[] x; // deklaracija zbirke void setup() { size(200, 200); x = new int[2]; // ustvarjanje zbirke x[0] = 12; // dodeljevanje prve vrednosti int[] x = new int[2]; // deklaracija in ustvarjanje zbirke void setup() { size(200, 200); x[0] = 12; // dodeljevanje prve vrednosti x[1] = 2; // dodeljevanje druge vrednosti int[] x = { 12, 2 ; // deklaracija, kreiranje in dodeljevanje void setup() { size(200, 200); x[1] = 2; // dodeljevanje druge vrednosti
51 Trki, kolizija (Collision) Ponavljanje in zbirke / Repetition and arrays 1. Zbirka je najprej zapolnjena z naključnim številom znotraj setup() ter 2. nato so te vrednosti uporabljene za določanje debeline črt znotraj draw(). Vsakič ko se zažene program, je nova naključna številka uporabljena v zbirki. 1. the Array is filled with the random number inside setup() and 2. then these values are used for definition for width of the lines inside draw(), each time the programme is started, the new random number is used in the Array float[] gray; void setup() { size(500, 250); gray = new float[width]; for (int i = 0; i < gray.length; i++) { gray[i] = random(0, 255); void draw() { for (int i = 0; i < gray.length; i++) { stroke(gray[i]); line(i, 0, i, height);
Using Methods. Methods that handle events. Mairead Meagher Dr. Siobhán Drohan. Produced by: Department of Computing and Mathematics
Using Methods Methods that handle events Produced by: Mairead Meagher Dr. Siobhán Drohan Department of Computing and Mathematics http://www.wit.ie/ Caveat The term function is used in Processing e.g. line(),
More informationKimberly Nguyen Professor Oliehoek Introduction to Programming 8 September 2013
1. A first program // Create 200x200 canvas // Print favorite quote size(200, 200); println("it is what it is"); // Draw rectangle and a line rect(100,100,50,50); line(0,0,50,50); // Save as.pde. Can be
More informationQuestion 1 (10 points) Write the correct answer in each of the following: a) Write a Processing command to create a canvas of 400x300 pixels:
Question 1 (10 points) Write the correct answer in each of the following: a) Write a Processing command to create a canvas of 400x300 pixels: size(400, 300); b) After the above command is carried out,
More information1 Getting started with Processing
cisc3665, fall 2011, lab I.1 / prof sklar. 1 Getting started with Processing Processing is a sketch programming tool designed for use by non-technical people (e.g., artists, designers, musicians). For
More informationA B C D CS105 03a Interaction
Interaction Function Definition Events Built-in Variables CS105 03a Interaction 1 Which image is drawn by this code? strokeweight(10); stroke(0, 255, 0); // green line(99, 0, 0, 99); stroke(200, 0, 200);
More informationConditional Events. Mouse events and Operators. Dr. Siobhán Drohan Mairead Meagher. Produced by:
Conditional Events Mouse events and Operators Produced by: Dr. Siobhán Drohan Mairead Meagher Department of Computing and Mathematics http://www.wit.ie/ Topics list Mouse Events Recap: Arithmetic Operators
More informationINTRODUCTION TO PROCESSING. Alark Joshi, Amit Jain, Jyh-haw Yeh and Tim Andersen
INTRODUCTION TO PROCESSING Alark Joshi, Amit Jain, Jyh-haw Yeh and Tim Andersen What is Processing? Processing is a programming language designed to make programming easier Developers were frustrated with
More informationmith College Computer Science CSC103 How Computers Work Week 7 Fall 2017 Dominique Thiébaut
mith College Computer Science CSC103 How Computers Work Week 7 Fall 2017 Dominique Thiébaut dthiebaut@smith.edu Important Review Does the animation leave a trace? Are the moving objects move without a
More informationVariables and Control Structures. CS 110 Eric Eaton
Variables and Control Structures CS 110 Eric Eaton Review Random numbers mousex, mousey setup() & draw() framerate(), loop(), noloop() Mouse and Keyboard interaccon Arcs, curves, bézier curves, custom
More informationmith College Computer Science CSC103 How Computers Work Week 6 Fall 2017 Dominique Thiébaut
mith College Computer Science CSC103 How Computers Work Week 6 Fall 2017 Dominique Thiébaut dthiebaut@smith.edu Ben Fry on Processing... http://www.youtube.com/watch?&v=z-g-cwdnudu An Example Mouse 2D
More informationWatch the following for more announcements
Review "plain text file" loadstrings() split() splittokens() selectinput() println(), float(), int(), can take an array argument, will return an array easy way to convert an array of Strings to an array
More informationCISC 1600, Lab 2.2: Interactivity in Processing
CISC 1600, Lab 2.2: Interactivity in Processing Prof Michael Mandel 1 Getting set up For this lab, we will again be using Sketchpad, a site for building processing sketches online using processing.js.
More informationExploring Processing
Exploring Processing What is Processing? Easy-to-use programming environment Let s you edit, run, save, share all in one application Designed to support interactive, visual applications Something we ve
More information2D Shapes. Creative Coding & Generative Art in Processing 2 Ira Greenberg, Dianna Xu, Deepak Kumar
2D Shapes Creative Coding & Generative Art in Processing 2 Ira Greenberg, Dianna Xu, Deepak Kumar Did you do this? Read Chapter 2 (pages 33-50) Read and do the Coordinate Systems & Shapes and Color tutorials
More informationCISC 1600, Lab 3.2: Interactivity in Processing
CISC 1600, Lab 3.2: Interactivity in Processing Prof Michael Mandel 1 Getting set up For this lab, we will be using OpenProcessing, a site for building processing sketches online using processing.js. 1.1.
More informationUniversity of Cincinnati. P5.JS: Getting Started. p5.js
p5.js P5.JS: Getting Started Matthew Wizinsky University of Cincinnati School of Design HTML + CSS + P5.js File Handling & Management Environment Canvas Coordinates Syntax Drawing Variables Mouse Position
More informationTransform 1: Translate, Matrices
Transform 1: Translate, Matrices This unit introduces coordinate system transformations and explains how to control their scope. Syntax introduced: translate(), pushmatrix(), popmatrix() The coordinate
More informationIntroduction to Processing. Sally Kong
Introduction to Processing Sally Kong - Open Source Platform - Geared toward creating visual, interactive media - Created by Ben Fry and Casey Reas Basic Setup void setup() { size(800, 600); background(255);
More informationRecall that creating or declaring a variable can be done as follows:
Lesson 2: & Conditionals Recall that creating or declaring a variable can be done as follows:! float radius = 20;! int counter = 5;! string name = Mr. Nickel ;! boolean ispressed = true;! char grade =
More informationCS110 Introduction to Computing Fall 2016 Practice Exam 1 -- Solutions
CS110 Introduction to Computing Fall 2016 Practice Exam 1 -- Solutions The exam will be closed-note and closed-book; please consider this fact before using your notes on this practice version. Please see
More informationCISC 1600 Lecture 2.2 Interactivity&animation in Processing
CISC 1600 Lecture 2.2 Interactivity&animation in Processing Topics: Interactivity: keyboard and mouse variables Interactivity: keyboard and mouse listeners Animation: vector graphics Animation: bitmap
More informationMiscellaneous Stuff That Might Be Important.
1 Miscellaneous Stuff That Might Be Important. Variable mousepressed VS function mousepressed( ) For much of the work in this class, it is usually safer to use the function form of mousepressed( ) instead
More informationModule 01 Processing Recap. CS 106 Winter 2018
Module 01 Processing Recap CS 106 Winter 2018 Processing is a language a library an environment Variables A variable is a named value. It has a type (which can t change) and a current value (which can
More informationCISC 1600 Lecture 2.2 Interactivity&animation in Processing
CISC 1600 Lecture 2.2 Interactivity&animation in Processing Topics: Interactivity: keyboard and mouse variables Interactivity: keyboard and mouse listeners Animation: vector graphics Animation: bitmap
More informationPrirejanje in preverjanje tipov
Uvod v C# Drugi del Dedovanje Sintaksa Prirejanje in preverjanje tipov Kaste preverjenih tipov Prekrivanje metod Dinamično povezovanje (poenostavljeno) Skrivanje Dinamično povezovanje (s skrivanjem) Fragile
More informationThe Processing language
The Processing language Developed by Ben Fry and Casey Reas at MIT in 2001 Related to the languages Logo and Java Free, open-source software processing.org contains many programming resources www.openprocessing.org
More informationFinal Exam Winter 2013
Final Exam Winter 2013 1. Which modification to the following program makes it so that the display shows just a single circle at the location of the mouse. The circle should move to follow the mouse but
More informationDržavni izpitni center SPOMLADANSKI IZPITNI ROK *M * NAVODILA ZA OCENJEVANJE. Četrtek, 2. junij 2016 SPLOŠNA MATURA
Državni izpitni center *M16178113* SPOMLADANSKI IZPITNI ROK NAVODILA ZA OCENJEVANJE Četrtek, 2. junij 2016 SPLOŠNA MATURA RIC 2016 M161-781-1-3 2 IZPITNA POLA 1 1 1 2 1 3 3 4 1 5 3 6 2 7 1 8 1 9 1 10 3
More informationPick a number. Conditionals. Boolean Logic Relational Expressions Logical Operators Numerical Representation Binary. CS Conditionals 1
Conditionals Boolean Logic Relational Expressions Logical Operators Numerical Representation Binary CS105 04 Conditionals 1 Pick a number CS105 04 Conditionals 2 Boolean Expressions An expression that
More informationThis unit introduces the basics of trigonometry and how to utilize it for generating form.
Math 3: Trigonometry This unit introduces the basics of trigonometry and how to utilize it for generating form. Syntax introduced: PI, QUARTER_PI, HALF_PI, TWO_PI, radians(), degrees() sin(), cos(), arc()
More informationIteration in Programming
Iteration in Programming for loops Produced by: Mairead Meagher Dr. Siobhán Drohan Department of Computing and Mathematics http://www.wit.ie/ Topics list There are three types of loop in programming: While
More informationCISC 1600 Lecture 3.1 Introduction to Processing
CISC 1600 Lecture 3.1 Introduction to Processing Topics: Example sketches Drawing functions in Processing Colors in Processing General Processing syntax Processing is for sketching Designed to allow artists
More informationvoid mouseclicked() { // Called when the mouse is pressed and released // at the same mouse position }
Review Commenting your code Random numbers and printing messages mousex, mousey void setup() & void draw() framerate(), loop(), noloop() Arcs, curves, bézier curves, beginshape/endshape Example Sketches
More informationWhat can we do with Processing? Let s check. Natural Language and Dialogue Systems Lab Guest Image. Remember how colors work.
MIDTERM REVIEW: THURSDAY I KNOW WHAT I WANT TO REVIEW. BUT ALSO I WOULD LIKE YOU TO TELL ME WHAT YOU MOST NEED TO GO OVER FOR MIDTERM. BY EMAIL AFTER TODAY S CLASS. What can we do with Processing? Let
More informationSten-SLATE ESP. Graphical Interface
Sten-SLATE ESP Graphical Interface Stensat Group LLC, Copyright 2016 1 References www.arduino.cc http://esp8266.github.io/arduino/versions/2.1.0/doc/reference.html 2 Graphical Interface In this section,
More informationBasic Computer Programming (Processing)
Contents 1. Basic Concepts (Page 2) 2. Processing (Page 2) 3. Statements and Comments (Page 6) 4. Variables (Page 7) 5. Setup and Draw (Page 8) 6. Data Types (Page 9) 7. Mouse Function (Page 10) 8. Keyboard
More informationGRAPHICS PROGRAMMING. LAB #3 Starting a Simple Vector Animation
GRAPHICS PROGRAMMING LAB #3 Starting a Simple Vector Animation Introduction: In previous classes we have talked about the difference between vector and bitmap images and vector and bitmap animations. In
More information01/42. Lecture notes. Processing Basics
01/42 Type in Motion For typography to move, the program must run continuously, and therefore it requires a draw() function. Using typography within draw() requires three steps. First, a PFont variable
More informationVariables. location where in memory is the information stored type what sort of information is stored in that memory
Variables Processing, like many programming languages, uses variables to store information Variables are stored in computer memory with certain attributes location where in memory is the information stored
More informationCS110 Introduction to Computing Fall 2016 Practice Exam 1
CS110 Introduction to Computing Fall 2016 Practice Exam 1 The exam will be closed-note and closed-book; please consider this fact before using your notes on this practice version. Please see the abbreviated
More informationClass #1. introduction, functions, variables, conditionals
Class #1 introduction, functions, variables, conditionals what is processing hello world tour of the grounds functions,expressions, statements console/debugging drawing data types and variables decisions
More informationCSC 220 Object-Oriented Multimedia Programming, Spring 2017
CSC 220 Object-Oriented Multimedia Programming, Spring 2017 Dr. Dale E. Parson, Assignment 2, Working with 3D shapes and geometric transforms. This assignment is due via D2L Dropbox Assignment 2 ShapePaint3DIntro
More informationSolution Notes. COMP 151: Terms Test
Family Name:.............................. Other Names:............................. ID Number:............................... Signature.................................. Solution Notes COMP 151: Terms
More informationModule 01 Processing Recap
Module 01 Processing Recap Processing is a language a library an environment Variables A variable is a named value. It has a type (which can t change) and a current value (which can change). Variables
More informationPerry Bible Fellowship [pbfcomics.com/94/]
Module 07 [@Zerglinator]? Perry Bible Fellowship [pbfcomics.com/94/] recursivedrawing.com ellipse() ellipse() rect() ellipse() rect() void mydrawing() {... } void mydrawing() { pushmatrix(); translate(...
More informationLab Lab 4 : Pretty, Pretty Pretty, Pretty Pictures Picture Joshua Cuneo
Computation as an Expressive Medium Lab 4: Pretty, Pretty Pictures Joshua Cuneo For today ¼ Checkpoint Building Blocks Assignment 2 Images + More Images Accessing Pixels 2D Arrays Project 2 Checkpoint
More informationProcessing 2: Creative Programming Cookbook
Processing 2: Creative Programming Cookbook Jan Vantomme Chapter No. 2 "Drawing Text, Curves, and Shapes in 2D" In this package, you will find: A Biography of the author of the book A preview chapter from
More informationComputer Graphics. Interaction
Computer Graphics Interaction Jordi Linares i Pellicer Escola Politècnica Superior d Alcoi Dep. de Sistemes Informàtics i Computació jlinares@dsic.upv.es http://www.dsic.upv.es/~jlinares processing allows
More informationCPSC Fall L01 Final Exam
CPSC 601.36 - Fall 2009 - L01 Final Exam Copyright Jeffrey Boyd 2009 December 12, 2009 Time: 120 minutes General instructions: 1. This exam is open-book. You may use any reference material you require,
More informationUsing Methods. More on writing methods. Dr. Siobhán Drohan Mairead Meagher. Produced by: Department of Computing and Mathematics
Using Methods More on writing methods Produced by: Dr. Siobhán Drohan Mairead Meagher Department of Computing and Mathematics http://www.wit.ie/ Topics list Method example: Eyes Method example: X s Overloading
More informationCS116X Midterm Review Winter 2015
CS116X Midterm Review Winter 2015 This review will most likely not cover everything that could possibly be on the exam. The following is intended to help you study but remember that you may be tested on
More information+ Inheritance. Sometimes we need to create new more specialized types that are similar to types we have already created.
+ Inheritance + Inheritance Classes that we design in Java can be used to model some concept in our program. For example: Pokemon a = new Pokemon(); Pokemon b = new Pokemon() Sometimes we need to create
More informationGetting Started in Java CIS 110
Getting Started in Java CIS 110 2 Your First Program Program name 3 Your First Program The 4 li es aside fro the System.out li e are o sidered the Scaffolding of the program. Section 1.1 4 Your First Program
More informationCS 101 Functions. Lecture 15
CS 101 Functions Lecture 15 1 Key Processing language features so-far Basic color/shapes drawing Variables For-loops If-statements 2 Functions In the next few days, we ll be talking about Functions A Function
More informationCISC 1600, Lab 2.1: Processing
CISC 1600, Lab 2.1: Processing Prof Michael Mandel 1 Getting set up For this lab, we will be using Sketchpad, a site for building processing sketches online using processing.js. 1.1. Go to http://cisc1600.sketchpad.cc
More informationFunctions. Functions. nofill(); point(20, 30); float angle = map(i, 0, 10, -2, 2); parameters return values
Functions parameters return values 06 Functions 1 Functions Code that is packaged so it can be run by name Often has parameters to change how the function works (but not always) Often performs some computation
More informationBraitenberg code. Page 1
// Processing source code : Braitenberg's Vehicles // Based on program written by william ngan // SensoryField class stub coded by Prof. Mateas and Mayhew Seavey in 2004... //...and
More informationLoops. Variable Scope Remapping Nested Loops. Donald Judd. CS Loops 1. CS Loops 2
Loops Variable Scope Remapping Nested Loops CS105 05 Loops 1 Donald Judd CS105 05 Loops 2 judd while (expression) { statements CS105 05 Loops 3 Four Loop Questions 1. What do I want to repeat? - a rect
More informationWrite a program that draws this image. The ligle squares are 5x5. The screen is the default 100x100. It doesn t change.
Chapter 7 Func.ons Recap func.on call statements setup() and draw() variables: declara.on, use, assignment if-else loops: while & for various operators (arithme.c, boolean, rela.onal, shortcut versions)
More informationThe Processing language. Arduino and Processing.
IAT267 Introduc/on to Technological Systems Lecture 8 The Processing language. Arduino and Processing. 1 Course Project All teams submibed very interes/ng proposals One requirement for the project is to
More informationInteraction Design A.A. 2017/2018
Corso di Laurea Magistrale in Design, Comunicazione Visiva e Multimediale - Sapienza Università di Roma Interaction Design A.A. 2017/2018 7 Conditionals in Processing Francesco Leotta, Andrea Marrella
More informationWhat is a variable? a named location in the computer s memory. mousex mousey. width height. fontcolor. username
What is a variable? a named location in the computer s memory mousex mousey width height fontcolor username Variables store/remember values can be changed must be declared to store a particular kind of
More informationCISC 1600, Lab 3.1: Processing
CISC 1600, Lab 3.1: Processing Prof Michael Mandel 1 Getting set up For this lab, we will be using OpenProcessing, a site for building processing sketches online using processing.js. 1.1. Go to https://www.openprocessing.org/class/57767/
More informationformati slike in branje slike pomen in nekaj primerov EM spekter aplikacije v posameznih delih spektra o matriki slike
Strojni vid pri tehnoloških meritvah formati slike in branje slike pomen in nekaj primerov EM spekter aplikacije v posameznih delih spektra o matriki slike formati slike in branje slike slika je običajno
More informationNotes from the Boards Set # 5 Page
1 Yes, this stuff is on the exam. Know it well. Read this before class and bring your questions to class. Starting today, we can no longer write our code as a list of function calls and variable declarations
More informationCOPYRIGHTED MATERIAL. Elements of the Language. C h a p t e r
C h a p t e r 1 Elements of the Language Processing is a computer language originally conceived by Ben Fry and Casey Reas, students at the time (2001) at MIT. Their objective was to develop a simple language
More informationCST112 Variables Page 1
CST112 Variables Page 1 1 3 4 5 6 7 8 Processing: Variables, Declarations and Types CST112 The Integer Types A whole positive or negative number with no decimal positions May include a sign, e.g. 10, 125,
More informationfloat[][] myfloats = new float[10][20]; All elements of a 2D array can be accessed using nested loops
Review We can declare an array of any type, even other arrays A 2D array is an array of arrays float[][] myfloats = new float[10][20]; All elements of a 2D array can be accessed using nested loops for
More informationGetting Started with Processing by Casey Reas and Ben Fry
Free Sampler Getting Started with Processing by Casey Reas and Ben Fry Copyright 2010 Casey Reas and Ben Fry. All rights reserved. Printed in the United States of America. Published by O Reilly Media,
More informationEP486 Microcontroller Applications
EP486 Microcontroller Applications Topic 2 Processing Department of Engineering Physics University of Gaziantep Sep 2013 Sayfa 1 Processing is a programming language, development environment, and online
More informationThis assignment was revised from the original PDF released to revise/add Parts D and E.
Behind the Digital Screen Assignment 5: Visualization Deadline: Monday, 4/11, 3pm (one hour before class begins) This assignment was revised from the original PDF released to revise/add Parts D and E.
More informationCSE120 Wi18 Final Review
CSE120 Wi18 Final Review Practice Question Solutions 1. True or false? Looping is necessary for complex programs. Briefly explain. False. Many loops can be explicitly written out as individual statements
More informationGetting Started with. Processing.py. Allison Parrish, Ben Fry, and. Casey Reas «J» MAKER MEDIA SAN FRANCISCO, CA
Getting Started with Processing.py Allison Parrish, Ben Fry, and Casey Reas «J» MAKER MEDIA SAN FRANCISCO, CA Preface. 1/Hello 1 Sketching and Prototyping 2 Flexibility 3 Giants 3 Family Tree 5 Join In
More informationProcessing Presentation by Ben Leduc-Mills
Processing http://processing.org Presentation by Ben Leduc-Mills Processing: History Processing is a free, open-source Java-based framework as well as an Integrated Development Environment (IDE). It was
More informationLecture 6: Processing
stanford hci group / cs377s Designing Applications that See Lecture 6: Processing Dan Maynes-Aminzade 24 January 2008 Designing Applications that See http://cs377s.stanford.edu Reminders Assignment t#
More informationCMPT-166: Sample Final Exam Answer Key
CMPT 166, Summer 2012, Surrey Sample Final Exam Answer Key Page 1 of 9 CMPT-166: Sample Final Exam Answer Key Last name exactly as it appears on your student card First name exactly as it appears on your
More information5.1. Examples: Going beyond Sequence
Chapter 5. Selection In Chapter 1 we saw that algorithms deploy sequence, selection and repetition statements in combination to specify computations. Since that time, however, the computations that we
More informationRAZLOG ZA IZVAJANJE PROGRAMA POPRBAZA
RAZLOG ZA IZVAJANJE PROGRAMA POPRBAZA POPRBAZA je namenjen večji reorganizaciji podatkov v računalnikovem spominu. Reorganizacijo narekujejo bodisi zakonske spremembe, bodisi novosti v programu. Zato je
More informationCST112 Looping Statements Page 1
CST112 Looping Statements Page 1 1 2 3 4 5 Processing: Looping Statements CST112 Algorithms Procedure for solving problem: 1. Actions to be executed 2. Order in which actions are executed order of elements
More informationCS 106 Winter Lab 03: Input and Output
CS 106 Winter 2019 Lab 03: Input and Output Due: Wednesday, January 23th, 11:59pm Summary This lab will allow you to practice input and output. Each question is on a separate page. SAVE each sketch as
More information(Inter)Ac*ve Scripts. Sta*c Program Structure 1/26/15. Crea+ve Coding & Genera+ve Art in Processing 2 Ira Greenberg, Dianna Xu, Deepak Kumar
(Inter)Ac*ve Scripts Crea+ve Coding & Genera+ve Art in Processing 2 Ira Greenberg, Dianna Xu, Deepak Kumar Slides revised by Michael Goldwasser Sta*c Program Structure // Create and set canvas size(width,
More informationCMPT-166: Sample Midterm
CMPT 166, Fall 2016, Surrey Sample Midterm 1 Page 1 of 11 CMPT-166: Sample Midterm Last name exactly as it appears on your student card First name exactly as it appears on your student card Student Number
More informationProcessing the Danger Shield
// About Processing: What Processing is: Processing is a Java based programming environment that draws on PostScript and OpenGL for 2-D and 3-D graphics respectively. Processing is a wonderful entry level
More informationGenerating Vectors Overview
Generating Vectors Overview Vectors are mathematically defined shapes consisting of a series of points (nodes), which are connected by lines, arcs or curves (spans) to form the overall shape. Vectors can
More informationIntroduction to Processing
Processing Introduction to Processing Processing is a programming environment that makes writing programs easier. It contains libraries and functions that make interacting with the program simple. The
More informationReal Time Data Plotting
Real Time Data Plotting Introduction This lesson will show how to write a program plot data on a X-Y graph. On the Arduino, write a program to sample a sensor and print the voltage to the Serial interface.
More information[ the academy_of_code] Senior Beginners
[ the academy_of_code] Senior Beginners 1 Drawing Circles First step open Processing Open Processing by clicking on the Processing icon (that s the white P on the blue background your teacher will tell
More informationAll program statements you write should be syntactically correct. Partial credit is not guaranteed with incorrect use of syntax.
With Solutions in Red CS110 Introduction to Computing Fall 2012 Section 2 Exam 1 This is an open notes exam. Computers are not permitted. Your work on this exam must be your own. Answer all questions in
More informationWe will start our journey into Processing with creating static images using commands available in Processing:
Processing Notes Chapter 1: Starting Out We will start our journey into Processing with creating static images using commands available in Processing: rect( ) line ( ) ellipse() triangle() NOTE: to find
More informationClass Notes CN19 Class PImage Page
1 Images and the Graphics Window Prior to beginning the work with different parts of the libraries, we spent time with classes. One reason for that was to provide some background when we started this part
More informationCS 101 Media (Images, Video, etc) Lecture 20
CS 101 Media (Images, Video, etc) Lecture 20 1 Images Though we ve displayed many shapes and colors to the screen, we have yet to display an actual image! Processing has a special type called PImage, for
More informationProcessing & Arduino in Tandem. Creating Your Own Digital Art Tools
Processing & Arduino in Tandem Creating Your Own Digital Art Tools Week 2 - Making your own drawing tool Using Processing to build a basic application Segment 1 - A Basic Drawing Program Change window
More informationif / if else statements
if / if else statements December 1 2 3 4 5 Go over if notes and samples 8 9 10 11 12 Conditionals Quiz Conditionals TEST 15 16 17 18 19 1 7:30 8:21 2 8:27 9:18 3 9:24 10:14 1 CLASS 7:30 8:18 1 FINAL 8:24
More information3/30/16. Program Structure. Drawing/Anima+on. Read input and create data objects. Basic Plots 50-99
Drawing/Anima+on Coordinate modifica.on No variables in the shape coordinates variables added to x and y trigs involving angle variable added to x and y scale factor mul.plied to x and y Transforma.ons
More informationProcessing. Data Visualization Programming Language. By Rutvi Joshi. Processing Visualization Language- By Rutvi Joshi
Processing Data Visualization Programming Language What is Processing? A Graphical Sketch Book and Environment, to graphically teach the fundamentals of computer science But it has evolved into a tool
More informationTehnike programiranja PREDAVANJE 2 Uvod v JavaScript
Tehnike programiranja PREDAVANJE 2 Uvod v JavaScript Predavanje 2 Ponovitev Predavanje 1 Naloge Uvod v JavaScript Pravila Primeri Priprava na laboratorijske vaje Pregled orodij ldos.fe.uni-lj.si >študij
More informationPractice Written Examination, Fall 2016 Roger B. Dannenberg, instructor
15-104 Practice Written Examination, Fall 2016 Roger B. Dannenberg, instructor Possibly useful function signatures (italics mean an expression goes here ): createcanvas(w, h); width height key background(r,
More informationOld 257 Exam #2s for Practice
Old Exam #2s 257/757 Exploring Programming with Graphics Page 1 Old 257 Exam #2s for Practice Exams will be taken on Thursday March 27 in the cluster. You will have the entire class time to do the exam.
More informationBits and Bytes. How do computers compute?
Bits and Bytes How do computers compute? Representing Data All data can be represented with: 1s and 0s on/of true/false Numbers? Five volunteers... Binary Numbers Positional Notation Binary numbers use
More informationChapter 8. More with classes Prac2ce with Zoog
Chapter 8 More with classes Prac2ce with Zoog // Another simple class practical example class BankAccount { int id; float amount; String name; BankAccount(int i, float amt, String nm){ id = i; amount =
More information