SlideShare ist ein Scribd-Unternehmen logo
1 von 25
An Introduction to
    Processing
      Cate Huston
What We’ll Cover

• Making your first Applet
• The Processing API (where you can find all
  kinds of useful methods)
• Animating an Applet in Processing
• Exporting your Applet
What’s Processing?
• “an electronic sketchbook for developing
  ideas”
• Open source environment
• Programming language (very similar to Java)
• Can be used as a library in Eclipse
• Makes it easy to create Applets
So What Can We Make?
• Personally, I like to use it to make Fractals
  and little games:
  • http://catehuston.com/processing.html
• But you can use Processing for all kinds of
  things, see:
  • http://processing.org/exhibition/
Getting Started
• Either
  • Get the version for your operating system
    from http://processing.org/download/
• Or get core.jar (this will be in the wave)
  • Make a new Project in Eclipse
  • Make a “lib” folder inside it, and put
    core.jar there
It should look like this. Notice that it’s inside
the workspace, but not inside another folder.
Right click on core.jar, and select
 Build Path -> Add to Build Path
Make a new class, but click on the “browse” button
next to the “Superclass” text box, and find “PApplet” -
        see how it’s in core.jar? And click OK.
See how the Superclass is different? This just means
 we’re building on top of “PApplet” - so we’re reusing
stuff that other people have made, and customizing it.
This is different from last time: see how we’re
importing PApplet, and our class extends PApplet.
When we make a Processing Applet
  we need these two methods.
If you’re pro you can use the @Override notation. This means that
we are “overriding” (replacing) a method in the Superclass (PApplet).
    Don’t worry if this doesn’t make sense, it’s not that important.
You’ll want your setup() method to look a bit
like this. Try running it and see what happens.
Size and Background
•   Play with the values we pass to size(), what
    happens if we make it size(500, 500) for
    example?

•   Play with the values we pass to background.
    What if we make it background(238)?

•   We can also call background with three values,
    which correspond to it’s RGB components. Try
    background(256, 0, 128).
Try adding some code to the
draw() method. What does this do?
The Draw() Method
• Try changing the colors and the numbers in
  the call to ellipse(). What does that do?
• See what else you can find at http://
  processing.org/reference/
  • Ellipse takes 4 arguments, what are they?
  • Try making some other shapes.
Making Cool Stuff
• Have multiple shapes!
• Can you use the constructs from the last
  session to make something more complex?
• How about using a loop?
• Change fill() and stroke() to add more
  color.
Lets try something more complicated: the values at the top (x, y, size and
 max) are global variables - this means we can use them in our setup()
 method as well as our draw() method. We’ll use draw() to animate our
       applet, taking away noLoop() means it gets called frequently.
This is our draw method. Each time it runs. it will update
 x and y - so the position of the object we draw will be
different. And the color will be a little different too. Try it!
Using Animation
• Try playing with the code and see what you
  can change.
• Can you use a different shape?
• What if you change the size of the shape
  (by changing size)?
• What else would you like to know how to
  do?
Exporting Your Applet
• Download the P5Exporter plugin from
  http://www.rednoise.org/ep5/ and drag it
  into your dropins folder inside the Eclipse
  folder in your file system.
• Restart Eclipse.
• You should see a new button at the top,
  click it and follow the instructions
  (screenshots follow).
See the button on the top left? That will start the P5
exporter. The select your applet on the right of the pop
up box. You want to output an applet, not an application.
Running Your Exported
Applet
• You’ll find the Applet inside your project
  folder, which is inside your workspace
  folder.
• It should be a folder called “applet”.
• Click on index.html and it will open up
  browser window - your applet should be
  there.
Finally...

• Processing has huge potential, we’ve not
  even scratched the surface here.
• Look at the exhibition (at processing.org)
  and get inspired!
• Think about what other things you’d like to
  be able to make.
@kittenthebad

http://www.catehuston.com/

catehuston@googlewave.com

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction To Scala
Introduction To ScalaIntroduction To Scala
Introduction To ScalaPeter Maas
 
Paris Web - Javascript as a programming language
Paris Web - Javascript as a programming languageParis Web - Javascript as a programming language
Paris Web - Javascript as a programming languageMarco Cedaro
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object ModelWebStackAcademy
 
Advanced Object Oriented JavaScript (prototype, closure, scope, design patterns)
Advanced Object Oriented JavaScript (prototype, closure, scope, design patterns)Advanced Object Oriented JavaScript (prototype, closure, scope, design patterns)
Advanced Object Oriented JavaScript (prototype, closure, scope, design patterns)raja kvk
 
Javascript Basics by Bonny
Javascript Basics by BonnyJavascript Basics by Bonny
Javascript Basics by BonnyBonny Chacko
 
使用.NET构建轻量级分布式框架
使用.NET构建轻量级分布式框架使用.NET构建轻量级分布式框架
使用.NET构建轻量级分布式框架jeffz
 
Shapeless- Generic programming for Scala
Shapeless- Generic programming for ScalaShapeless- Generic programming for Scala
Shapeless- Generic programming for ScalaKnoldus Inc.
 
TDD and mobile development: some forgotten techniques, illustrated with Android
TDD and mobile development: some forgotten techniques, illustrated with AndroidTDD and mobile development: some forgotten techniques, illustrated with Android
TDD and mobile development: some forgotten techniques, illustrated with AndroidCodemotion
 
Kotlin for Android Development
Kotlin for Android DevelopmentKotlin for Android Development
Kotlin for Android DevelopmentSpeck&Tech
 
Intro to Ruby on Rails
Intro to Ruby on RailsIntro to Ruby on Rails
Intro to Ruby on Railselpizoch
 
Functional programming in Javascript
Functional programming in JavascriptFunctional programming in Javascript
Functional programming in JavascriptKnoldus Inc.
 
002. Introducere in type script
002. Introducere in type script002. Introducere in type script
002. Introducere in type scriptDmitrii Stoian
 
My client wanted their apps synced, and I made it with Go
My client wanted their apps synced, and I made it with GoMy client wanted their apps synced, and I made it with Go
My client wanted their apps synced, and I made it with GoToru Furukawa
 
Getting started with typescript and angular 2
Getting started with typescript  and angular 2Getting started with typescript  and angular 2
Getting started with typescript and angular 2Knoldus Inc.
 
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced JavascriptDhruvin Shah
 
10 Things I Hate About Scala
10 Things I Hate About Scala10 Things I Hate About Scala
10 Things I Hate About ScalaMeir Maor
 

Was ist angesagt? (20)

Introduction To Scala
Introduction To ScalaIntroduction To Scala
Introduction To Scala
 
Paris Web - Javascript as a programming language
Paris Web - Javascript as a programming languageParis Web - Javascript as a programming language
Paris Web - Javascript as a programming language
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
Advanced Object Oriented JavaScript (prototype, closure, scope, design patterns)
Advanced Object Oriented JavaScript (prototype, closure, scope, design patterns)Advanced Object Oriented JavaScript (prototype, closure, scope, design patterns)
Advanced Object Oriented JavaScript (prototype, closure, scope, design patterns)
 
Javascript Basics by Bonny
Javascript Basics by BonnyJavascript Basics by Bonny
Javascript Basics by Bonny
 
Use the @types, Luke
Use the @types, LukeUse the @types, Luke
Use the @types, Luke
 
Lecture 5 javascript
Lecture 5 javascriptLecture 5 javascript
Lecture 5 javascript
 
使用.NET构建轻量级分布式框架
使用.NET构建轻量级分布式框架使用.NET构建轻量级分布式框架
使用.NET构建轻量级分布式框架
 
Shapeless- Generic programming for Scala
Shapeless- Generic programming for ScalaShapeless- Generic programming for Scala
Shapeless- Generic programming for Scala
 
TDD and mobile development: some forgotten techniques, illustrated with Android
TDD and mobile development: some forgotten techniques, illustrated with AndroidTDD and mobile development: some forgotten techniques, illustrated with Android
TDD and mobile development: some forgotten techniques, illustrated with Android
 
Kotlin for Android Development
Kotlin for Android DevelopmentKotlin for Android Development
Kotlin for Android Development
 
Intro to Ruby on Rails
Intro to Ruby on RailsIntro to Ruby on Rails
Intro to Ruby on Rails
 
Functional programming in Javascript
Functional programming in JavascriptFunctional programming in Javascript
Functional programming in Javascript
 
002. Introducere in type script
002. Introducere in type script002. Introducere in type script
002. Introducere in type script
 
My client wanted their apps synced, and I made it with Go
My client wanted their apps synced, and I made it with GoMy client wanted their apps synced, and I made it with Go
My client wanted their apps synced, and I made it with Go
 
Getting started with typescript and angular 2
Getting started with typescript  and angular 2Getting started with typescript  and angular 2
Getting started with typescript and angular 2
 
Coding in kotlin
Coding in kotlinCoding in kotlin
Coding in kotlin
 
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced Javascript
 
Typescript
TypescriptTypescript
Typescript
 
10 Things I Hate About Scala
10 Things I Hate About Scala10 Things I Hate About Scala
10 Things I Hate About Scala
 

Andere mochten auch

Arduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the ArduinoArduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the ArduinoEoin Brazil
 
Respeaking as a part of translation and interpreting curriculum
Respeaking as a part of translation and interpreting curriculumRespeaking as a part of translation and interpreting curriculum
Respeaking as a part of translation and interpreting curriculumUniversity of Warsaw
 
He had such quiet eyes
He  had such quiet eyesHe  had such quiet eyes
He had such quiet eyesWan Firdaus
 
SAP Business Object Material
SAP Business Object Material SAP Business Object Material
SAP Business Object Material erpsoln
 
Project 2016 progress template 25% completed
Project 2016 progress template  25% completedProject 2016 progress template  25% completed
Project 2016 progress template 25% completedThomas Wheeler
 
5 kinesis lightning
5 kinesis lightning5 kinesis lightning
5 kinesis lightningBigDataCamp
 
Slides of webinar: growing advisory businesses through alternative assets
Slides of webinar:   growing advisory businesses through alternative assetsSlides of webinar:   growing advisory businesses through alternative assets
Slides of webinar: growing advisory businesses through alternative assetsMichael Sakraida
 
Asat book0-fresh blood
Asat book0-fresh bloodAsat book0-fresh blood
Asat book0-fresh bloodAshraf Ali
 
CV_Zhang Haochenzi 2015:10:08
CV_Zhang Haochenzi 2015:10:08CV_Zhang Haochenzi 2015:10:08
CV_Zhang Haochenzi 2015:10:08haochenzi zhang
 
Q3 2013 ASSA ABLOY investors presentation 28 october
Q3 2013 ASSA ABLOY investors presentation 28 octoberQ3 2013 ASSA ABLOY investors presentation 28 october
Q3 2013 ASSA ABLOY investors presentation 28 octoberASSA ABLOY
 
BÍ QUYẾT QUẢN LÝ HIỆU QUẢ CÂU LẠC BỘ CHA MẸ VÀ VỊ THÀNH NIÊN, THANH NIÊN
BÍ QUYẾT QUẢN LÝ HIỆU QUẢ CÂU LẠC BỘ CHA MẸ VÀ VỊ THÀNH NIÊN, THANH NIÊNBÍ QUYẾT QUẢN LÝ HIỆU QUẢ CÂU LẠC BỘ CHA MẸ VÀ VỊ THÀNH NIÊN, THANH NIÊN
BÍ QUYẾT QUẢN LÝ HIỆU QUẢ CÂU LẠC BỘ CHA MẸ VÀ VỊ THÀNH NIÊN, THANH NIÊNCGFED
 
Are you good at doing sports?
Are you good at doing sports?Are you good at doing sports?
Are you good at doing sports?onlychild21
 

Andere mochten auch (20)

Install PostgreSQL on CentOS
Install PostgreSQL on CentOSInstall PostgreSQL on CentOS
Install PostgreSQL on CentOS
 
Introduction to Processing
Introduction to ProcessingIntroduction to Processing
Introduction to Processing
 
Arduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the ArduinoArduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the Arduino
 
Respeaking as a part of translation and interpreting curriculum
Respeaking as a part of translation and interpreting curriculumRespeaking as a part of translation and interpreting curriculum
Respeaking as a part of translation and interpreting curriculum
 
Status report1
Status report1Status report1
Status report1
 
NEC Japan
NEC JapanNEC Japan
NEC Japan
 
He had such quiet eyes
He  had such quiet eyesHe  had such quiet eyes
He had such quiet eyes
 
SAP Business Object Material
SAP Business Object Material SAP Business Object Material
SAP Business Object Material
 
Being polite to strangers
Being polite to strangersBeing polite to strangers
Being polite to strangers
 
Project 2016 progress template 25% completed
Project 2016 progress template  25% completedProject 2016 progress template  25% completed
Project 2016 progress template 25% completed
 
Proff presentation
Proff presentationProff presentation
Proff presentation
 
5 kinesis lightning
5 kinesis lightning5 kinesis lightning
5 kinesis lightning
 
Slides of webinar: growing advisory businesses through alternative assets
Slides of webinar:   growing advisory businesses through alternative assetsSlides of webinar:   growing advisory businesses through alternative assets
Slides of webinar: growing advisory businesses through alternative assets
 
Asat book0-fresh blood
Asat book0-fresh bloodAsat book0-fresh blood
Asat book0-fresh blood
 
TJOLI
TJOLITJOLI
TJOLI
 
CV_Zhang Haochenzi 2015:10:08
CV_Zhang Haochenzi 2015:10:08CV_Zhang Haochenzi 2015:10:08
CV_Zhang Haochenzi 2015:10:08
 
Q3 2013 ASSA ABLOY investors presentation 28 october
Q3 2013 ASSA ABLOY investors presentation 28 octoberQ3 2013 ASSA ABLOY investors presentation 28 october
Q3 2013 ASSA ABLOY investors presentation 28 october
 
Abc c program
Abc c programAbc c program
Abc c program
 
BÍ QUYẾT QUẢN LÝ HIỆU QUẢ CÂU LẠC BỘ CHA MẸ VÀ VỊ THÀNH NIÊN, THANH NIÊN
BÍ QUYẾT QUẢN LÝ HIỆU QUẢ CÂU LẠC BỘ CHA MẸ VÀ VỊ THÀNH NIÊN, THANH NIÊNBÍ QUYẾT QUẢN LÝ HIỆU QUẢ CÂU LẠC BỘ CHA MẸ VÀ VỊ THÀNH NIÊN, THANH NIÊN
BÍ QUYẾT QUẢN LÝ HIỆU QUẢ CÂU LẠC BỘ CHA MẸ VÀ VỊ THÀNH NIÊN, THANH NIÊN
 
Are you good at doing sports?
Are you good at doing sports?Are you good at doing sports?
Are you good at doing sports?
 

Ähnlich wie An Introduction to Processing

Speaking 'Development Language' (Or, how to get your hands dirty with technic...
Speaking 'Development Language' (Or, how to get your hands dirty with technic...Speaking 'Development Language' (Or, how to get your hands dirty with technic...
Speaking 'Development Language' (Or, how to get your hands dirty with technic...Julie Meloni
 
Scilab for real dummies j.heikell - part 1
Scilab for real dummies j.heikell - part 1Scilab for real dummies j.heikell - part 1
Scilab for real dummies j.heikell - part 1Scilab
 
intro-to-eclipse.pdf
intro-to-eclipse.pdfintro-to-eclipse.pdf
intro-to-eclipse.pdfSajeev P
 
Introduction to c first week slides
Introduction to c first week slidesIntroduction to c first week slides
Introduction to c first week slidesluqman bawany
 
Hasktut
HasktutHasktut
Hasktutkv33
 
Python_Introduction&DataType.pptx
Python_Introduction&DataType.pptxPython_Introduction&DataType.pptx
Python_Introduction&DataType.pptxHaythamBarakeh1
 
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018Mike Harris
 
Principled io in_scala_2019_distribution
Principled io in_scala_2019_distributionPrincipled io in_scala_2019_distribution
Principled io in_scala_2019_distributionRaymond Tay
 
Drupal 8: A story of growing up and getting off the island
Drupal 8: A story of growing up and getting off the islandDrupal 8: A story of growing up and getting off the island
Drupal 8: A story of growing up and getting off the islandAngela Byron
 
Mastering Python lesson3b_for_loops
Mastering Python lesson3b_for_loopsMastering Python lesson3b_for_loops
Mastering Python lesson3b_for_loopsRuth Marvin
 
Generative Testing in Clojure
Generative Testing in ClojureGenerative Testing in Clojure
Generative Testing in ClojureAlistair Roche
 
Recursion with details Implementation.pptx
Recursion with details Implementation.pptxRecursion with details Implementation.pptx
Recursion with details Implementation.pptxmrhabib10
 
EN Intro to Recursion by Slidesgo.pptx
EN Intro to Recursion by Slidesgo.pptxEN Intro to Recursion by Slidesgo.pptx
EN Intro to Recursion by Slidesgo.pptxmrsk83179
 

Ähnlich wie An Introduction to Processing (20)

First app
First appFirst app
First app
 
Speaking 'Development Language' (Or, how to get your hands dirty with technic...
Speaking 'Development Language' (Or, how to get your hands dirty with technic...Speaking 'Development Language' (Or, how to get your hands dirty with technic...
Speaking 'Development Language' (Or, how to get your hands dirty with technic...
 
Scilab for real dummies j.heikell - part 1
Scilab for real dummies j.heikell - part 1Scilab for real dummies j.heikell - part 1
Scilab for real dummies j.heikell - part 1
 
scilab
scilabscilab
scilab
 
intro-to-eclipse.pdf
intro-to-eclipse.pdfintro-to-eclipse.pdf
intro-to-eclipse.pdf
 
Introduction to c first week slides
Introduction to c first week slidesIntroduction to c first week slides
Introduction to c first week slides
 
Hasktut
HasktutHasktut
Hasktut
 
Python_Introduction&DataType.pptx
Python_Introduction&DataType.pptxPython_Introduction&DataType.pptx
Python_Introduction&DataType.pptx
 
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
 
Principled io in_scala_2019_distribution
Principled io in_scala_2019_distributionPrincipled io in_scala_2019_distribution
Principled io in_scala_2019_distribution
 
Drupal 8: A story of growing up and getting off the island
Drupal 8: A story of growing up and getting off the islandDrupal 8: A story of growing up and getting off the island
Drupal 8: A story of growing up and getting off the island
 
Lab a
Lab aLab a
Lab a
 
Applets
AppletsApplets
Applets
 
Applets
AppletsApplets
Applets
 
Mastering Python lesson3b_for_loops
Mastering Python lesson3b_for_loopsMastering Python lesson3b_for_loops
Mastering Python lesson3b_for_loops
 
Generative Testing in Clojure
Generative Testing in ClojureGenerative Testing in Clojure
Generative Testing in Clojure
 
Recursion with details Implementation.pptx
Recursion with details Implementation.pptxRecursion with details Implementation.pptx
Recursion with details Implementation.pptx
 
EN Intro to Recursion by Slidesgo.pptx
EN Intro to Recursion by Slidesgo.pptxEN Intro to Recursion by Slidesgo.pptx
EN Intro to Recursion by Slidesgo.pptx
 
Python training
Python trainingPython training
Python training
 
ACM init() Spring 2015 Day 1
ACM init() Spring 2015 Day 1ACM init() Spring 2015 Day 1
ACM init() Spring 2015 Day 1
 

Mehr von Cate Huston

15 Tools to Make University Easier
15 Tools to Make University Easier15 Tools to Make University Easier
15 Tools to Make University EasierCate Huston
 
Holiday Science Lecture: Art, Life and Programming
Holiday Science Lecture: Art, Life and ProgrammingHoliday Science Lecture: Art, Life and Programming
Holiday Science Lecture: Art, Life and ProgrammingCate Huston
 
Art, Life and Programming
Art, Life and ProgrammingArt, Life and Programming
Art, Life and ProgrammingCate Huston
 
Art, Life and Programming
Art, Life and ProgrammingArt, Life and Programming
Art, Life and ProgrammingCate Huston
 
Microsoft Vista: A Usability Problem
Microsoft Vista: A Usability ProblemMicrosoft Vista: A Usability Problem
Microsoft Vista: A Usability ProblemCate Huston
 

Mehr von Cate Huston (8)

15 Tools to Make University Easier
15 Tools to Make University Easier15 Tools to Make University Easier
15 Tools to Make University Easier
 
Holiday Science Lecture: Art, Life and Programming
Holiday Science Lecture: Art, Life and ProgrammingHoliday Science Lecture: Art, Life and Programming
Holiday Science Lecture: Art, Life and Programming
 
Art, Life and Programming
Art, Life and ProgrammingArt, Life and Programming
Art, Life and Programming
 
Art, Life and Programming
Art, Life and ProgrammingArt, Life and Programming
Art, Life and Programming
 
Web 2.0
Web 2.0Web 2.0
Web 2.0
 
Processing
ProcessingProcessing
Processing
 
iPhone Commerce
iPhone CommerceiPhone Commerce
iPhone Commerce
 
Microsoft Vista: A Usability Problem
Microsoft Vista: A Usability ProblemMicrosoft Vista: A Usability Problem
Microsoft Vista: A Usability Problem
 

Kürzlich hochgeladen

General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 

Kürzlich hochgeladen (20)

Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 

An Introduction to Processing

  • 1. An Introduction to Processing Cate Huston
  • 2. What We’ll Cover • Making your first Applet • The Processing API (where you can find all kinds of useful methods) • Animating an Applet in Processing • Exporting your Applet
  • 3. What’s Processing? • “an electronic sketchbook for developing ideas” • Open source environment • Programming language (very similar to Java) • Can be used as a library in Eclipse • Makes it easy to create Applets
  • 4. So What Can We Make? • Personally, I like to use it to make Fractals and little games: • http://catehuston.com/processing.html • But you can use Processing for all kinds of things, see: • http://processing.org/exhibition/
  • 5. Getting Started • Either • Get the version for your operating system from http://processing.org/download/ • Or get core.jar (this will be in the wave) • Make a new Project in Eclipse • Make a “lib” folder inside it, and put core.jar there
  • 6. It should look like this. Notice that it’s inside the workspace, but not inside another folder.
  • 7. Right click on core.jar, and select Build Path -> Add to Build Path
  • 8. Make a new class, but click on the “browse” button next to the “Superclass” text box, and find “PApplet” - see how it’s in core.jar? And click OK.
  • 9. See how the Superclass is different? This just means we’re building on top of “PApplet” - so we’re reusing stuff that other people have made, and customizing it.
  • 10. This is different from last time: see how we’re importing PApplet, and our class extends PApplet.
  • 11. When we make a Processing Applet we need these two methods.
  • 12. If you’re pro you can use the @Override notation. This means that we are “overriding” (replacing) a method in the Superclass (PApplet). Don’t worry if this doesn’t make sense, it’s not that important.
  • 13. You’ll want your setup() method to look a bit like this. Try running it and see what happens.
  • 14. Size and Background • Play with the values we pass to size(), what happens if we make it size(500, 500) for example? • Play with the values we pass to background. What if we make it background(238)? • We can also call background with three values, which correspond to it’s RGB components. Try background(256, 0, 128).
  • 15. Try adding some code to the draw() method. What does this do?
  • 16. The Draw() Method • Try changing the colors and the numbers in the call to ellipse(). What does that do? • See what else you can find at http:// processing.org/reference/ • Ellipse takes 4 arguments, what are they? • Try making some other shapes.
  • 17. Making Cool Stuff • Have multiple shapes! • Can you use the constructs from the last session to make something more complex? • How about using a loop? • Change fill() and stroke() to add more color.
  • 18. Lets try something more complicated: the values at the top (x, y, size and max) are global variables - this means we can use them in our setup() method as well as our draw() method. We’ll use draw() to animate our applet, taking away noLoop() means it gets called frequently.
  • 19. This is our draw method. Each time it runs. it will update x and y - so the position of the object we draw will be different. And the color will be a little different too. Try it!
  • 20. Using Animation • Try playing with the code and see what you can change. • Can you use a different shape? • What if you change the size of the shape (by changing size)? • What else would you like to know how to do?
  • 21. Exporting Your Applet • Download the P5Exporter plugin from http://www.rednoise.org/ep5/ and drag it into your dropins folder inside the Eclipse folder in your file system. • Restart Eclipse. • You should see a new button at the top, click it and follow the instructions (screenshots follow).
  • 22. See the button on the top left? That will start the P5 exporter. The select your applet on the right of the pop up box. You want to output an applet, not an application.
  • 23. Running Your Exported Applet • You’ll find the Applet inside your project folder, which is inside your workspace folder. • It should be a folder called “applet”. • Click on index.html and it will open up browser window - your applet should be there.
  • 24. Finally... • Processing has huge potential, we’ve not even scratched the surface here. • Look at the exhibition (at processing.org) and get inspired! • Think about what other things you’d like to be able to make.