SlideShare a Scribd company logo
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

More Related Content

What's hot

Introduction To Scala
Introduction To ScalaIntroduction To Scala
Introduction To Scala
Peter 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 language
Marco Cedaro
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
WebStackAcademy
 
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
 
Use the @types, Luke
Use the @types, LukeUse the @types, Luke
Use the @types, Luke
Brooklyn Zelenka
 
Lecture 5 javascript
Lecture 5 javascriptLecture 5 javascript
Lecture 5 javascript
Mujtaba Haider
 
使用.NET构建轻量级分布式框架
使用.NET构建轻量级分布式框架使用.NET构建轻量级分布式框架
使用.NET构建轻量级分布式框架jeffz
 
Shapeless- Generic programming for Scala
Shapeless- Generic programming for ScalaShapeless- Generic programming for Scala
Shapeless- Generic programming for Scala
Knoldus 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 Android
Codemotion
 
Kotlin for Android Development
Kotlin for Android DevelopmentKotlin for Android Development
Kotlin for Android Development
Speck&Tech
 
Intro to Ruby on Rails
Intro to Ruby on RailsIntro to Ruby on Rails
Intro to Ruby on Rails
elpizoch
 
Functional programming in Javascript
Functional programming in JavascriptFunctional programming in Javascript
Functional programming in Javascript
Knoldus Inc.
 
002. Introducere in type script
002. Introducere in type script002. Introducere in type script
002. Introducere in type script
Dmitrii 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 Go
Toru 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 2
Knoldus Inc.
 
Coding in kotlin
Coding in kotlinCoding in kotlin
Coding in kotlin
Debmalya Jash
 
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced Javascript
Dhruvin Shah
 
Typescript
TypescriptTypescript
Typescript
Nikhil Thomas
 
10 Things I Hate About Scala
10 Things I Hate About Scala10 Things I Hate About Scala
10 Things I Hate About Scala
Meir Maor
 

What's hot (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
 

Viewers also liked

Install PostgreSQL on CentOS
Install PostgreSQL on CentOSInstall PostgreSQL on CentOS
Install PostgreSQL on CentOS
Rangson Sangboonruang
 
Introduction to Processing
Introduction to ProcessingIntroduction to Processing
Introduction to Processing
Green Moon Solutions
 
Arduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the ArduinoArduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the Arduino
Eoin 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 curriculum
University of Warsaw
 
NEC Japan
NEC JapanNEC Japan
NEC Japan
Dave Michels
 
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
 
Being polite to strangers
Being polite to strangersBeing polite to strangers
Being polite to strangers
Irsalina Viramdani
 
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 assets
Michael Sakraida
 
Asat book0-fresh blood
Asat book0-fresh bloodAsat book0-fresh blood
Asat book0-fresh blood
Ashraf Ali
 
TJOLI
TJOLITJOLI
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 october
ASSA ABLOY
 
Abc c program
Abc c programAbc c program
Abc c program
Dayakar Siddula
 
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
CGFED
 
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
 

Viewers also liked (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?
 

Similar to 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 1
Scilab
 
intro-to-eclipse.pdf
intro-to-eclipse.pdfintro-to-eclipse.pdf
intro-to-eclipse.pdf
Sajeev P
 
Introduction to c first week slides
Introduction to c first week slidesIntroduction to c first week slides
Introduction to c first week slides
luqman bawany
 
Hasktut
HasktutHasktut
Hasktutkv33
 
Python_Introduction&DataType.pptx
Python_Introduction&DataType.pptxPython_Introduction&DataType.pptx
Python_Introduction&DataType.pptx
HaythamBarakeh1
 
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
Mike Harris
 
Principled io in_scala_2019_distribution
Principled io in_scala_2019_distributionPrincipled io in_scala_2019_distribution
Principled io in_scala_2019_distribution
Raymond 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 island
Angela Byron
 
Lab a
Lab aLab a
Lab a
sam-pee
 
Applets
AppletsApplets
Applets
Inayat Sharma
 
Mastering Python lesson3b_for_loops
Mastering Python lesson3b_for_loopsMastering Python lesson3b_for_loops
Mastering Python lesson3b_for_loops
Ruth Marvin
 
Generative Testing in Clojure
Generative Testing in ClojureGenerative Testing in Clojure
Generative Testing in Clojure
Alistair Roche
 
Recursion with details Implementation.pptx
Recursion with details Implementation.pptxRecursion with details Implementation.pptx
Recursion with details Implementation.pptx
mrhabib10
 
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
mrsk83179
 
Python training
Python trainingPython training
Python training
Kunalchauhan76
 
ACM init() Spring 2015 Day 1
ACM init() Spring 2015 Day 1ACM init() Spring 2015 Day 1
ACM init() Spring 2015 Day 1
UCLA Association of Computing Machinery
 

Similar to 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
 

More from Cate Huston

15 Tools to Make University Easier
15 Tools to Make University Easier15 Tools to Make University Easier
15 Tools to Make University Easier
Cate 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 Programming
Cate 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
 
Web 2.0
Web 2.0Web 2.0
Web 2.0
Cate Huston
 
iPhone Commerce
iPhone CommerceiPhone Commerce
iPhone Commerce
Cate Huston
 
Microsoft Vista: A Usability Problem
Microsoft Vista: A Usability ProblemMicrosoft Vista: A Usability Problem
Microsoft Vista: A Usability Problem
Cate Huston
 

More from 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
 

Recently uploaded

TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 

Recently uploaded (20)

TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 

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.