An Artist's Guide to Programming

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Learn to program with visual examples. Programs increase in complexity as you progress — from drawing a circle to 3D graphics, animations, and simulations. A Graphical Introduction to Programming teaches computer programming with the aid of 100 example programs, each of which integrates graphical or sound output. The Processing-language-based examples range from drawing a circle and animating bouncing balls to 3D graphics, audio visualization, and interactive games. Readers learn core programming concepts like conditions, loops, arrays, strings and functions, as well as how to use Processing to draw lines, shapes, and 3D objects. They’ll learn key computer graphics concepts like manipulating images, animating text, mapping textures onto objects, and working with video. Advanced examples include sound effects and audio visualization, network communication, 3D geometry and animation, simulations of snow and smoke, predator-prey populations, and interactive games.

Author(s): Jim Parker
Edition: 1
Publisher: No Starch Press
Year: 2022

Language: English
Pages: 250
Tags: Processing programming language; Processing; Programming

TITLE PAGE
COPYRIGHT

ABOUT THE AUTHOR

AUTHOR’S NOTE

INTRODUCTION
The Basics of a Programming Language: Processing
The Beginning
The Middle
The Rest
Variables
How to Write a Program

PART 1: THE FUNDAMENTALS OF DRAWING
Sketch 1: A Circle
Example A
Example B
Example C
Sketch 2: Colors
Example A
Example B
Sketch 3: if Statements—Changing Colors Conditionally
Example A
Example B
Example C
Sketch 4: Loops—Drawing 20 Circles
Example A
Example B
Sketch 5: Lines
Example A
Example B
Sketch 6: Arrays—Drawing Many Circles
Sketch 7: Lines with Rubber Banding
Sketch 8: Random Circles
Sketch 9: A Rectangle
Sketch 10: Triangles and Motion
Sketch 11: Displaying Text
Sketch 12: Manipulating Text Strings

PART 2: WORKING WITH PREEXISTING IMAGES
Sketch 13: Loading and Displaying an Image
Example A
Example B
Sketch 14: Images—Theory and Practice
Example A
Example B
Sketch 15: Manipulating Images I—Aspect Ratio
Example A
Example B
Sketch 16: Manipulating Images II—Cropping
Sketch 17: Manipulating Images III—Magnifier
Sketch 18: Rotation
Example A
Example B
Sketch 19: Rotating About Any Point—Translation
Example A
Example B
Sketch 20: Rotating an Image
Sketch 21: Getting the Value of a Pixel
Sketch 22: Setting and Changing the Values of Pixels
Example A
Example B
Sketch 23: Changing the Values of Pixels—Thresholding
Sketch 24: User-Defined Functions
Sketch 25: Elements of Programming Style
Sketch 26: Duplicating Images—More Functions

PART 3: 2D GRAPHICS AND ANIMATION
Sketch 27: Saving an Image and Adjusting Transparency
Sketch 28: Bouncing an Object in a Window
Sketch 29: Basic Sprite Graphics
Sketch 30: Detecting Sprite-Sprite Collisions
Sketch 31: Animation—Generating TV Static
Sketch 32: Frame Animation
Example A
Example B
Sketch 33: Flood Fill—Filling in Complex Shapes

PART 4: WORKING WITH TEXT AND FILES
Sketch 34: Fonts, Sizes, Character Properties
Sketch 35: Scrolling Text
Sketch 36: Text Animation
Sketch 37: Inputting a Filename
Sketch 38: Inputting an Integer
Sketch 39: Reading Parameters from a File
Sketch 40: Writing Text to a File
Sketch 41: Simulating Text on a Computer Screen

PART 5: CREATING USER INTERFACES AND WIDGETS
Sketch 42: A Button
Sketch 43: The Class Object—Multiple Buttons
Sketch 44: A Slider
Sketch 45: A Gauge Display
Sketch 46: A Likert Scale
Sketch 47: A Thermometer

PART 6: NETWORK COMMUNICATIONS
Sketch 48: Opening a Web Page
Example A
Example B
Sketch 49: Loading Images from a Web Page
Sketch 50: Client/Server Communication

PART 7: 3D GRAPHICS AND ANIMATION
Sketch 51: Basic 3D Objects
Example A
Example B
Sketch 52: 3D Geometry—Viewpoints, Projections
Sketch 53: 3D Illumination
Sketch 54: Bouncing a Ball in 3D
Sketch 55: Constructing 3D Objects Using Planes
Sketch 56: Texture Mapping
Sketch 57: Billboards—Simulating a Tree
Sketch 58: Moving the Viewpoint in 3D
Sketch 59: Spotlights
Sketch 60: A Driving Simulation

PART 8: ADVANCED GRAPHICS AND ANIMATION
Sketch 61: Layering
Sketch 62: Seeing the World Through a Window
Sketch 63: The PShape Object—A Rotating Planet
Sketch 64: Splines—Drawing Curves
Sketch 65: A Driving Simulation with Waypoints
Sketch 66: Many Small Objects—A Snowstorm
Sketch 67: Particle Graphics—Smoke
Sketch 68: Saving a State—A Spinning Propeller
Sketch 69: L-Systems—Drawing Plants
Sketch 70: Warping an Image

PART 9: WORKING WITH SOUND
Sketch 71: Playing a Sound File
Sketch 72: Displaying a Sound’s Volume
Sketch 73: Bouncing a Ball with Sound Effects
Sketch 74: Mixing Two Sounds
Sketch 75: Displaying Audio Waveforms
Sketch 76: Controlling a Graphic with Sound
Sketch 77: Positional Sound
Sketch 78: Synthetic Sounds
Sketch 79: Recording and Saving Sound

PART 10: WORKING WITH VIDEO
Sketch 80: Playing a Video
Sketch 81: Playing a Video with a Jog Wheel
Sketch 82: Saving Still Frames from a Video
Sketch 83: Processing Video in Real Time
Sketch 84: Capturing Video from a Webcam
Sketch 85: Mapping Live Video as a Texture

PART 11: MEASURING AND SIMULATING TIME
Sketch 86: Displaying a Clock
Sketch 87: Time Differences—Measuring Reaction Time
Sketch 88: M/M/1 Queue—Time in Simulations

PART 12: CREATING SIMULATIONS AND GAMES
Sketch 89: Predator-Prey Simulation
Sketch 90: Flocking Behavior
Sketch 91: Simulating the Aurora
Sketch 92: A Dynamic Advertisement
Sketch 93: Nim
Sketch 94: Pathfinding
Sketch 95: Metaballs—A Lava Lamp
Sketch 96: A Robot Arm
Sketch 97: Lightning
Sketch 98: The Computer Game Breakout
Sketch 99: Midpoint Displacement—Simulating Terrain

PART 13: MAKING YOUR WORK PUBLIC
Sketch 100: Processing on the Web