Home Page Icon
Home Page
Table of Contents for
O'Reilly Strata Conference
Close
O'Reilly Strata Conference
by Ben Fry, Casey Reas
Getting Started with Processing
Getting Started with Processing
A Note Regarding Supplemental Files
Advance Praise for Getting Started with Processing
Preface
How This Book Is Organized
Who This Book Is For
Conventions Used in This Book
Using Code Examples
How to Contact Us
SafariĀ® Books Online
Acknowledgments
1. Hello
Sketching and Prototyping
Flexibility
Giants
Family Tree
Join In
2. Starting to Code
Your First Program
Example 2-1: Draw an Ellipse
Example 2-2: Make Circles
Show
Save
Share
Examples and Reference
3. Draw
Example 3-1: Draw a Window
Example 3-1: Draw a Window
Example 3-2: Draw a Point
Basic Shapes
Example 3-3: Draw a Line
Example 3-4: Draw Basic Shapes
Example 3-5: Draw a Rectangle
Example 3-6: Draw an Ellipse
Example 3-7: Draw Part of an Ellipse
Example 3-8: Draw with Degrees
Drawing Order
Example 3-9: Control Your Drawing Order
Example 3-10: Put It in Reverse
Shape Properties
Example 3-11: Draw Smooth Lines
Example 3-12: Set Stroke Weight
Example 3-13: Set Stroke Attributes
Color
Example 3-14: Paint with Grays
Example 3-15: Control Fill and Stroke
Example 3-16: Draw with Color
Example 3-17: Set Transparency
Custom Shapes
Example 3-18: Draw an Arrow
Example 3-19: Close the Gap
Example 3-20: Create Some Creatures
Comments
Robot 1: Draw
4. Variables
Example 4-1: Reuse the Same Values
Example 4-1: Reuse the Same Values
Example 4-2: Change Values
Making Variables
Processing Variables
Example 4-3: Adjust the Size, See What Follows
A Little Math
Example 4-4: Basic Arithmetic
Repetition
Example 4-5: Do the Same Thing Over and Over
Example 4-6: Use a for Loop
Example 4-7: Flex Your for Loop's Muscles
Example 4-8: Fanning Out the Lines
Example 4-9: Kinking the Lines
Example 4-10: Embed One for Loop in Another
Example 4-11: Rows and Columns
Example 4-12: Pins and Lines
Example 4-13: Halftone Dots
Robot 2: Variables
5. Response
Example 5-1: The draw() Function
Example 5-1: The draw() Function
Example 5-2: The setup() Function
Example 5-3: setup(), Meet draw()
Follow
Example 5-4: Track the Mouse
Example 5-5: The Dot Follows You
Example 5-6: Draw Continuously
Example 5-7: Set Thickness on the Fly
Example 5-8: Easing Does It
Example 5-9: Smooth Lines with Easing
Map
Example 5-10: Map Values to a Range
Example 5-11: Map with the map() Function
Click
Example 5-12: Click the Mouse
Example 5-13: Detect When Not Clicked
Example 5-14: Multiple Mouse Buttons
Location
Example 5-15: Find the Cursor
Example 5-16: The Bounds of a Circle
Example 5-17: The Bounds of a Rectangle
Type
Example 5-18: Tap a Key
Example 5-19: Draw Some Letters
Example 5-20: Check for Specific Keys
Example 5-21: Move with Arrow Keys
Robot 3: Response
6. Media
Images
Example 6-1: Load an Image
Example 6-2: Load More Images
Example 6-3: Mousing Around with Images
Example 6-4: Transparency with a GIF
Example 6-5: Transparency with a PNG
Fonts
Example 6-6: Drawing with Fonts
Example 6-7: Draw Text in a Box
Example 6-8: Store Text in a String
Shapes
Example 6-9: Draw with Shapes
Example 6-10: Scaling Shapes
Robot 4: Media
7. Motion
Example 7-1: See the Frame Rate
Example 7-1: See the Frame Rate
Example 7-2: Set the Frame Rate
Speed and Direction
Example 7-3: Move a Shape
Example 7-4: Wrap Around
Example 7-5: Bounce Off the Wall
Tweening
Example 7-6: Calculate Tween Positions
Random
Example 7-7: Generate Random Values
Example 7-8: Draw Randomly
Example 7-9: Move Shapes Randomly
Timers
Example 7-10: Time Passes
Example 7-11: Triggering Timed Events
Circular
Example 7-12: Sine Wave Values
Example 7-13: Sine Wave Movement
Example 7-14: Circular Motion
Example 7-15: Spirals
Translate, Rotate, Scale
Example 7-16: Translating Location
Example 7-17: Multiple Translations
Example 7-18: Isolating Transformations
Example 7-19: Rotation
Example 7-20: Combining Transformations
Example 7-21: Scaling
Example 7-22: Keeping Strokes Consistent
Example 7-23: An Articulating Arm
Robot 5: Motion
8. Functions
Function Basics
Example 8-1: Roll the Dice
Example 8-2: Another Way to Roll
Make a Function
Example 8-3: Draw the Owl
Example 8-4: Two's Company
Example 8-5: An Owl Function
Example 8-6: Increasing the Surplus Population
Example 8-7: Owls of Different Sizes
Return Values
Example 8-8: Return a Value
Robot 6: Functions
9. Objects
Classes and Objects
Define a Class
Example 9-1: Make an Object
Example 9-2: Making Multiple Objects
Robot 7: Objects
10. Arrays
Example 10-1: Many Variables
Example 10-1: Many Variables
Example 10-2: Too Many Variables
Example 10-3: Arrays, Not Variables
Make an Array
Example 10-4: Declare and Assign an Array
Example 10-5: Compact Array Assignment
Example 10-6: Assigning to an Array in One Go
Example 10-7: Revisiting the First Example
Repetition and Arrays
Example 10-8: Filling an Array in a for Loop
Example 10-9: Track Mouse Movements
Arrays of Objects
Example 10-10: Managing Many Objects
Example 10-11: Sequences of Images
Robot 8: Arrays
11. Extend
3D
Example 11-1: A 3D Demo
Example 11-2: Lighting
Example 11-3: The Processing Camera
Image Export
Example 11-4: Saving Images
Example 11-5: Draw to a PDF
Hello Arduino
Example 11-6: Read a Sensor
Example 11-7: Read Data from the Serial Port
Example 11-8: Visualizing the Data Stream
Example 11-9: Another Way to Look at the Data
Community
A. Coding Tips
Functions and Parameters
Color Coding
Comments
Uppercase and Lowercase
Style
Console
One Step at a Time
B. Data Types
C. Order of Operations
D. Variable Scope
Index
About the Authors
Colophon
Copyright
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Cover
Next
Next Chapter
Getting Started with Processing
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset