Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
215 views
Processing Cheat Sheet English
Dicas rápidas para começar um sketch em Processing.
Uploaded by
josé rodolfo masiero
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Processing Cheat Sheet English For Later
Download
Save
Save Processing Cheat Sheet English For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
215 views
Processing Cheat Sheet English
Dicas rápidas para começar um sketch em Processing.
Uploaded by
josé rodolfo masiero
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Processing Cheat Sheet English For Later
Carousel Previous
Carousel Next
Save
Save Processing Cheat Sheet English For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 9
Search
Fullscreen
open srattack com nk Erasure arent ret void setup()¢ 7/Runs only once y void draw(o{ Runs repeatedly during the execution } @ variables Types int Postve and negative integer variables. float Floating point negative and postive variables boolean Variables of whch vals can be! TRUE or FALSE ‘Stores color type values in diferent formats, char Stores a single character. string Stores a single string, Cy id size (width, height); Sets main window size in pixels, background(color); Sets window background colar. smooth() ‘Sets antialiasing on FrameRate (fps); Sols the application's FPS. printIn(string); rites a string to the console CUE a id rrandom(low, high) ; Retums @ random value within the ints, randonSeed(seed) ; ‘Changes random seed. noise(value); tums a value in Perl Nolse sequence. noiseDetail (octaves) Sets detail tireshod for noise function results noiseSeed(seed) ; (Changes noise seed. width Rotums sketch's width n pixol height tums sketch's height in pels mouseX tur mouse pointer's postion (axis) nouseY Rotur mouse pointe's positon (Y axis) prouseX. FRetums previous mouse pointer's X axis prouse¥ Fetums previous mouse pointer's ¥ axis. frameCount tums sketch's curent fame, FrameRate Retums skotch's curent FPS, Fill(color); ‘Sets the color used to fil shapes. noFil1(); Disables fil color stroke(color); ‘Sets the color used to draw strokes/borders around shapes. noStroke() ; Disables border for shapes. #1110255); #2110255); noFA1LOs nostroke(); stroke(@); stroke(@) ora aay colorMode (mode) ; ‘Set color mode, Usually RGB or HSB. red(color); Return the ed value ofthe color green(color) Fetum the green value ofthe color. blue(color) ; FRetum the blue value ofthe color. hue(color) ; Return the hue value of the color. saturation(color); tum the eaturation value ofthe coor. brightness(color); tum the brightness value ofthe color. alpha(color) FRetum the transparency value ofthe color. LerpColor (colort ,color2,noment) tums @ color value betwoon two colors.Popa is peer SS cur color (grayscale); color (grayscale, alpha); © 199) (255) color(red, green, blue) ; ml a color(red, green,blue, alpha) ; (255,0,0) (@,255,0) (0,0, 255) (255,255,0) (0,255,255) (255,0, 255) @ Coordinates system xX 4, > yi? In any Processing sketch, top left comer is the (0, 0) point. That axis changes when we make Use of translate) or rotate). © 122,100) Minimum unit of measurement in a computer screen is the Pixel. © (120,200) pushMatrix(); Saves the current matrix. Meaning the “translate, rotate and scale" values, For every pushMatix() belongs a final popMatrix) popMatrix() ; ‘Allows you to go back to the last saved matrix. You need a previous pushMatrx() to go back to an older matrix printMatrix(); Prints current matrix tothe console. translate posx, posy) Moves the anchor point to a certain postion After this the (0,0) isthe certain postion. rotate(radians) ; Changes plane rotation according to axis scale(x,y) Scales the plane, affects al sizes on the sketoh can also be: scaly.2) or scalmutiple), shearX(radians) ‘Applies a shear on X avs shearY(radians) ; Apples a shear on ¥ ax. rotatex(radians) ; Applies rotation to X axis, Works only on 3D enviroments rotateY (radians) ; Apples rotation to Y ax, Works only on 2D enviroments. rotateZ(radians) ‘Applies rotation to Z axis, Works only on 3D enviroments pushstyle(); Saves the curent style of fil), stroke tint), strokeWeigh, strokeCap),strokeJoing, imageMode), rectModel, elipseMode), shapeMode), colorModep, textAlgng, textFont, texiModeo, textSizo),toxtLeadingd, emissived, specular), shininess), ambient popstyle(); Goes back to lat siyle used. You need a previous pushStye0 to go back to an older stylePais perrereceens om oe eres width, height rt ery ee neigh ead eC point (posx, posy) ; Draws a point fo the screen. quad(x1,y1 x2, y2,x3,y3,x4, y4) 5 Draws a quadflateral based upon the our vertex positions we pass. arc(posx,posy, width, height, startangle, endangle) ; Rea MST) y! posx2, Cone Draws an arc in position (posx, posy), with size "width" and "height", and ‘startangle" and “endangle' passed as radians. triangle (xt, y1,x2,¥2,x3, 93); Draws a tangle based upon three postions passed as arguments @ Bezier and curves bezier(x1, yl, x2, y2, x3, y3, x4, v4) Draws a Bezier- positions 1 and 4 are the main anchor points, 2 and 3 work as control points, bezierDetail (level); Sets the Bezier detail evel bezierTangent(a, b, c, d, moment); Retume the Beziers tangent at “time” bezierPoint(a, b, c, d, moment); Fetus the Beziers axis positon at “time curve(xt, yl, x2, y2, x3, y3, x4, y4); Draws a curve. postions 1 and 4 are the main anchor points, 2 and 3 work as control points. curveTightness(tightness) ; Sets tightness forthe next curves. curvePoint(a, b, c, d, t); Retums the curve's axis position at "time". curveTangent(a, b, c, d, t); FRotums the curve's tangent at "time" curveDetail (detail); Sets the curve detal level rv) beginShape() and endShape() beginshape(); ‘Stars Istening for vertices to build a shape. It stops listening ‘when endShaped is called. Modes can be passed as arguments, ‘endShape() ; ‘Stops listening for vertices. vertex(posx, posy); Draws a vertex in position (o08x. posy) bezierVertex(x2, y2, x3, y3, x4, y4); Defines a vertex based on a Bezier curv. curveVertex(x, y); Defines a vertex based on a curve texture(PImage) ; Sets the texture fora drawn shape. beginContour(); Starts Istening for vertices to cut a previous form endContour(); ‘Stops listening for "beginContour’ vertices.@ Functions structure // Create the function void hello (){ printin("Hello } / Call the function insult; Create) class ClassName( ClassNane (/+Variables*/)( MIC ictor y void methodNane(/+Variables*/){ ) } //declare an objec ClassNane myClass; void setup(t Initialize an object myClass = new ClassNane(/*Variables*/); } void draw()¢ Hcal ject method myClass.methodName() ; farables or variables //Simple usage of For loop for(int i = 0;i
/INested For loop for(int i = ;i
Rear Eat eee en PFont font; void setup() £ font = loadFont(”Helvetica-32.v1w"); textFont(font, 32); y void draw() ¢ text ("Hello”, 0, 0); ‘image img, posx, posy, width, height); Draws an image in the main screen. Loadtmage(fileNane) ; Initalzes a Plage passing an image ile name or path as ‘an argument requestImage (FileName) ; Inialzes a Plmage on a separate toad. tint (color) ; ‘Sets the tint value ofan image. noTint(); Disables image tint. saveFrane(filenane) ; text (string, posx, posy); Displays text on the screen. LoadFont (FileName); Initalzes a Pont passing a font fle name or path as an argument. textFont (font, size); ‘Sets font type and size, textAlign (mode) ; Sets align mode to: LEFT, FIGHT or CENTER. textLeading(size); cing between lines of extn units of px Ou Re ag Ce RE fee SS ier PShape myshape; void setup() £ myshape = loadShape(""nyShape. svg"); y void draw) ¢ shape(nyshape, @, 0); bee een ed float x; Weasing value float easing = 0.05; void setup() ¢ size(22e, 120); > void draw() ¢ background(e); float targetX = mousex; x += (targetX - x) * easing; ellipse(x, 42, 10, 10);@ Events captur ‘ void mousePressed() Funs when any mouse button is pressed. void mouseClicked() uns when any mouse button is pressed and released, void mouseMoved() uns everytime mouse is moved and NOT pressed. 3 void mouseDragged() i uns everytime mouse is moved while a button is pressed void mouseReleased() Funs when any mouse button is released Z void keyPressed() uns on a key press event void keyTyped() uns when a key is pressed except for SHIFT, CTRL of ALT. void keyReleased() uns on akey reloase event. Pears k ctrl) Rute geserck cree) Cv sistent eee LV ines tener anol void draw() ¢ void draw() { if (keyPressed == true) { if mousePressed == true) { Fi11(@); //If any key is pressed Fi11(@); //If mouse is pressed } else ¢ ) else ( . Fi11(255); //0therwise #i11(255); //0therwise y y 3 rect(25, 25, 58, 50); rect(25, 25, 50, 50); 2 ? 1's a special variable w 3 ee Paneer og eee void draw) { void keyPressed() { z if (keyPressed) ( iF (key == CODED) ¢ af (key == 'b" [| key == '8') ( if (keyCode i Tf B key is pressed // If UP arrow key is pressed } } else if (keyCode == DOWN) { } else { /1 Tf down arrow key is press : // otherwise > > p else ¢ ) // Otherwise 2 5 ? = aor Se SS eS@ one dimension array int [] arrayint = { 43, -2, 8, 1}; //peclaration of an Particle (] particles; ject array printIn(arrayInt£0]) ;// Prints 43 printIn(arrayInt{1]);// Prints -2 void setup(rc 3 printIn(arrayInt{2]);// Prints & /Set the size of our array particles = new Particle(5@]; 3 for(int i = 0; particles. length; i++){ particles[i] = new Particle(); ? Cv ore dard ‘1 s void draw(o{ call a function of each object for(int i = 0; isparticles length; i++)( particlesCiJ.dran(); //peclaration of an array int [1] arrayint; void setup(y( /set the array's size > arrayint = new int(50]; 2 mnitialize each index value for(int i = @; icarraylnt. length; i+)¢ arrayInt{i) = ) > Void draw(y¢ //oeclaration ray Uiaurteaa tec eaviel cerita a int CIC] array20; for(int 4 = @; icarrayint.length; it+){ printIn(arrayintCil) ; Cenod ) //peclaration of our array y array20 = new int[width]Cheight]; //initializing every index ae forCint 1 = 6; tewiathy tee for(int j = 0; jcheight; 5++)¢ array2D[iJ03] = int (random(1@6)); @ array functions nia ‘append(array, value) ; > ‘Acid a value to an aay. arrayCopy(sre, srcPos, dst, dstPos, length); Copy an array or art oft inte another void draw(o{ //Pisplaying each index value for(int i = @; iswidth; in){ ‘concat (a,b); for(int j = @; icheight; j++)¢ CConcatenates two arrays. printIn(array20[iJCi]); expand(array,newSize) ; 5 Expands and array's size value. ) reverse(array); > Roverses an array order. shorten(array); Reduces aray's size by one index. sort(array); Sorts an aray in increasing order. splice (array, value/array, index) ; Inserts a value or an array inside any given index subset(array, start, count) Extracts set from a given aay from ‘star to "countPeace Cac EGAN lass ‘An excelent 00k for beginners Covers a let of tonics, Parictly oxolaned, Interactivity. It's an introduction to Processing, Opentameworks and Arduino. Covers many aspects of of the three, Ce eae) ees [A good book at a complement to “Learning Processing", bath of them 900d introduction Ce eel Prue i cs 1 2 Generative at rented book Covers same Processing based projects And comes witha blo exanphs 10 ovnioas, ey ee and Computational Art. aries Another good attemative to start ‘with Processing. Contains @ verse mount of examples eee eu) cease “This book reviews some important aspects to go further inthe task of Teaming Processingprocessing. org (Ofical Procesing's webste, Docuretaton and dowricad openprocessing. org (Open Processing community where you can upload and review related works. wiki.processing. org Processing's official Wik. forum.processing.org Processing offal forum. vimeo. con/channels/processing Processing channel on Vimeo, flickr. com/groups/processing/ Processing account on Flickr creativeapplications.net This forum gathers digital installations and works made with Processing and ot createdigitalmotion.com One of the most updated blogs with information about new communication media reatve coding tools wy Uae ALT = VAN) ee eee nts Se oS RS ee Mee oes)
You might also like
Graphics in Python
PDF
No ratings yet
Graphics in Python
10 pages
26.22 LP - Car128803
PDF
No ratings yet
26.22 LP - Car128803
9 pages
Euro 3 Euro 3: Chassis 6x6
PDF
No ratings yet
Euro 3 Euro 3: Chassis 6x6
4 pages
Audi Sound System: Operating Instructions
PDF
100% (1)
Audi Sound System: Operating Instructions
76 pages
4346 Instructions
PDF
No ratings yet
4346 Instructions
5 pages
Pelle CASE 788 Uniquement Schéma Électriques
PDF
No ratings yet
Pelle CASE 788 Uniquement Schéma Électriques
50 pages
Esk 150.5
PDF
No ratings yet
Esk 150.5
2 pages
E 30 Brake System Schaffer 4350Z
PDF
No ratings yet
E 30 Brake System Schaffer 4350Z
3 pages
McCormick C-MAX Tier 3 (2008-) - RS22 - 100 Tractor Service Repair Manual PDF
PDF
No ratings yet
McCormick C-MAX Tier 3 (2008-) - RS22 - 100 Tractor Service Repair Manual PDF
26 pages
Parts Manual: Dumpers 350 AH
PDF
No ratings yet
Parts Manual: Dumpers 350 AH
72 pages
16S2220 To 1367002030 PDF
PDF
No ratings yet
16S2220 To 1367002030 PDF
73 pages
Burty Zaladunkowe ANTEO PDF
PDF
No ratings yet
Burty Zaladunkowe ANTEO PDF
30 pages
Y08544 1115 PDF
PDF
No ratings yet
Y08544 1115 PDF
28 pages
171711-1 A Betriebsanleitung en-US PDF
PDF
No ratings yet
171711-1 A Betriebsanleitung en-US PDF
46 pages
04-06 Part Number of Connectors
PDF
No ratings yet
04-06 Part Number of Connectors
40 pages
Exhibitor List
PDF
No ratings yet
Exhibitor List
21 pages
Kubota M7950DT Piezas
PDF
100% (1)
Kubota M7950DT Piezas
285 pages
Kubota Kx121-2
PDF
No ratings yet
Kubota Kx121-2
310 pages
SsangYong Rexton - Rodius TOD
PDF
No ratings yet
SsangYong Rexton - Rodius TOD
5 pages
Telma 继电器盒
PDF
No ratings yet
Telma 继电器盒
3 pages
Cx,.vel.16as 2631 To
PDF
No ratings yet
Cx,.vel.16as 2631 To
89 pages
Catalogo Parti Di Ricambio: Spare Parts List
PDF
No ratings yet
Catalogo Parti Di Ricambio: Spare Parts List
6 pages
FIAT 160-90 Nr976 1985-Englisch
PDF
No ratings yet
FIAT 160-90 Nr976 1985-Englisch
28 pages
Schaeffler Corporate Presentation
PDF
No ratings yet
Schaeffler Corporate Presentation
9 pages
DACHAI CA498 части ДВС
PDF
No ratings yet
DACHAI CA498 части ДВС
5 pages
IVECO ML120E21 Bez Mostova, Kočnica-Parts Catalogue
PDF
No ratings yet
IVECO ML120E21 Bez Mostova, Kočnica-Parts Catalogue
660 pages
February '96: 710-19 CARRARO AXLE Ref. 126139 For "J.I. CASE" Spare Parts List
PDF
No ratings yet
February '96: 710-19 CARRARO AXLE Ref. 126139 For "J.I. CASE" Spare Parts List
7 pages
1B20 40
PDF
No ratings yet
1B20 40
4 pages
Acer Aspire 4738G (Quanta ZQ9)
PDF
No ratings yet
Acer Aspire 4738G (Quanta ZQ9)
45 pages
Engine For Industrial Applications: 240-520 KW - 322-697 HP at 2100 Min - RPM EU Stage III B / US EPA Tier 4 Interim
PDF
No ratings yet
Engine For Industrial Applications: 240-520 KW - 322-697 HP at 2100 Min - RPM EU Stage III B / US EPA Tier 4 Interim
6 pages
552 566 Parts Coleman Mach
PDF
100% (1)
552 566 Parts Coleman Mach
15 pages
Processing Cheat Sheet Spanish PDF
PDF
No ratings yet
Processing Cheat Sheet Spanish PDF
9 pages
Lucrare de Curs La SDA
PDF
No ratings yet
Lucrare de Curs La SDA
33 pages
Introduction GM Funcions
PDF
No ratings yet
Introduction GM Funcions
7 pages
Processing Cheat Sheet
PDF
No ratings yet
Processing Cheat Sheet
1 page
Computer Graphics (Lab File) - Satyam
PDF
No ratings yet
Computer Graphics (Lab File) - Satyam
61 pages
CGM Practical File by Akshat Agrawal
PDF
No ratings yet
CGM Practical File by Akshat Agrawal
21 pages
Computer Graphics Anurag
PDF
No ratings yet
Computer Graphics Anurag
13 pages
Windows GDI Programming: CIS 487/587 Bruce R. Maxim UM-Dearborn
PDF
No ratings yet
Windows GDI Programming: CIS 487/587 Bruce R. Maxim UM-Dearborn
32 pages
Cad Lab Maniual
PDF
No ratings yet
Cad Lab Maniual
65 pages
Lab Manual cg-2-26
PDF
No ratings yet
Lab Manual cg-2-26
25 pages
NIIT - Graphics and Multimedia Subject Code - BSIT-51
PDF
No ratings yet
NIIT - Graphics and Multimedia Subject Code - BSIT-51
24 pages
C++ Graphics For Windows Using Winbgim: Download and Install The Winbgim Devpak File "Winbgim-6.0-1G17L.Devpak"
PDF
No ratings yet
C++ Graphics For Windows Using Winbgim: Download and Install The Winbgim Devpak File "Winbgim-6.0-1G17L.Devpak"
7 pages
Graphics in C Lab Manual Chapter Rab Nawaz Jadoon PDF
PDF
No ratings yet
Graphics in C Lab Manual Chapter Rab Nawaz Jadoon PDF
16 pages
Winbgim Manual
PDF
100% (1)
Winbgim Manual
133 pages
Cs2405 Cglab Manual Onlyalgorithms
PDF
No ratings yet
Cs2405 Cglab Manual Onlyalgorithms
30 pages
Idoc
PDF
No ratings yet
Idoc
6 pages
Graphics: Initializes The Graphics System
PDF
No ratings yet
Graphics: Initializes The Graphics System
7 pages
Cs2405 Computer Graphics Lab Manual-New
PDF
100% (1)
Cs2405 Computer Graphics Lab Manual-New
115 pages
Graphics Functions
PDF
No ratings yet
Graphics Functions
7 pages
HARSH CG LAP File
PDF
No ratings yet
HARSH CG LAP File
45 pages
Computation As An Expressive Computation As An Expressive Medium Medium Medium Medium
PDF
No ratings yet
Computation As An Expressive Computation As An Expressive Medium Medium Medium Medium
44 pages
A Display Model: Bjarne Stroustrup
PDF
No ratings yet
A Display Model: Bjarne Stroustrup
44 pages
15 19-44-54graphics Library With Dev-C
PDF
No ratings yet
15 19-44-54graphics Library With Dev-C
8 pages
Computer Graphic Lab File
PDF
No ratings yet
Computer Graphic Lab File
56 pages
I Doc
PDF
No ratings yet
I Doc
6 pages
Turbo C Graphics Programming
PDF
50% (2)
Turbo C Graphics Programming
8 pages
Drawing and Image Processing in Python With Myro Graphics: Dr. Paige H. Meeker
PDF
No ratings yet
Drawing and Image Processing in Python With Myro Graphics: Dr. Paige H. Meeker
67 pages
Doraemon
PDF
0% (1)
Doraemon
40 pages