48
Chapter 3
3.2.5 SKETCHES AND SKETCHBOOK
All Processing projects are called sketches. Each sketch bas its own folder. The main file
for each sketch has the same name as the folder and is found inside. For example, if the
sketch is named "Sketch 123", the folder for the sketch will be called Sketch 123" and the
main file will be called "Sketch_123.pde". The PDE file extension is an acronym for the
Processing Development Environment.
Processing sketches can be stored anywhere on your computer, but by default they are
stored in the sketchbook, which will be in different places on your computer or
network,depending if you usc PC, Mac, or Linux and how the preferences are set. To
locate this folder, select the"Preferences" option from the File menu (or from the
"Processing" menu on the Mac) and look for the "Sketchbook location."
A sketch folder sometimes contains other folders for media files and other code. When a
font or image is added to a sketch by selecting "Add File..." from the Sketch menu, a
"data" folder is created. Files may also be added to your Processing sketch by dragging
them into the text editor. Image and sound files dragged into the application window will
automatically be added to the current sketch's "data" folder. All images, fonts, sounds,
and other data files loaded in the sketch must be in this folder.
Using the 3-dimension coordinate system of P3D, the z- coordinate is zero at the surface
of the image, With the negative z-values moving back in space. When drawing in 3D,
the camera is positioned in the center of the screen.
3.2.6. TABS, MULTIPLE FILES AND CLASSES
It can be inconvenient to write a long program within a single file. When Processing
sketches to hundreds or thousands of lines, breaking them into modular units helps
manage the different parts. Processing manages files with the Sketchbook and each
sketch can have multiple files that are managed with tabs.
The arrow button to the right of the tabs in the Processing Development Environment