Processing for Android: Create Mobile, Sensor-aware, and XR Applications Using Processing, 2nd Edition Andrés Colubri 2024 Scribd Download
Processing for Android: Create Mobile, Sensor-aware, and XR Applications Using Processing, 2nd Edition Andrés Colubri 2024 Scribd Download
com
https://ebookmeta.com/product/processing-for-android-create-
mobile-sensor-aware-and-xr-applications-using-
processing-2nd-edition-andres-colubri/
OR CLICK BUTTON
DOWNLOAD NOW
https://ebookmeta.com/product/nuclear-power-past-present-and-
future-2nd-edition-elliott/
ebookmeta.com
Practice Makes Perfect: Basic Spanish, Premium Third
Edition Dorothy Richmond
https://ebookmeta.com/product/practice-makes-perfect-basic-spanish-
premium-third-edition-dorothy-richmond/
ebookmeta.com
https://ebookmeta.com/product/gender-in-film-and-video-1st-edition-
neal-king/
ebookmeta.com
https://ebookmeta.com/product/machine-learning-for-high-risk-
applications-approaches-to-responsible-ai-patrick-hall/
ebookmeta.com
https://ebookmeta.com/product/mediatization-and-mobile-lives-a-
critical-approach-1st-edition-andre-jansson/
ebookmeta.com
https://ebookmeta.com/product/outlines-of-russian-culture-
part-3-architecture-painting-and-music-paul-miliukov-editor/
ebookmeta.com
International Relations Music and Diplomacy Sounds and
Voices on the International Stage Frédéric Ramel
https://ebookmeta.com/product/international-relations-music-and-
diplomacy-sounds-and-voices-on-the-international-stage-frederic-ramel/
ebookmeta.com
Processing for Android
Create Mobile, Sensor-aware, and XR
Applications Using Processing
Second Edition
Andrés Colubri
Processing for Android: Create Mobile, Sensor-aware, and XR Applications Using
Processing, Second Edition
Andrés Colubri
University of Massachusetts, Worcester, MA, USA
■
■Part I: First Steps with Processing for Android���������������������������������� 1
■
■Chapter 1: Getting Started with the Android Mode����������������������������������������������� 3
What Is the Processing Project?��������������������������������������������������������������������������������������� 3
The Processing Language���������������������������������������������������������������������������������������������������������������������� 3
The Processing Development Environment�������������������������������������������������������������������������������������������� 4
Extending Processing������������������������������������������������������������������������������������������������������� 6
The Contribution Manager���������������������������������������������������������������������������������������������������������������������� 7
Summary������������������������������������������������������������������������������������������������������������������������ 16
■
■Chapter 2: The Processing Language������������������������������������������������������������������ 17
A Programming Sketchbook for Artists and Designers�������������������������������������������������� 17
The Structure of a Processing Sketch���������������������������������������������������������������������������� 17
v
■ Table of Contents
Summary������������������������������������������������������������������������������������������������������������������������ 51
■
■Part II: Drawing and Interaction������������������������������������������������������� 53
■
■Chapter 4: Drawing Graphics and Text���������������������������������������������������������������� 55
Drawing Shapes������������������������������������������������������������������������������������������������������������� 55
More Types of Shapes��������������������������������������������������������������������������������������������������������������������������� 55
Curve Shapes��������������������������������������������������������������������������������������������������������������������������������������� 58
Using Bézier Curves����������������������������������������������������������������������������������������������������������������������������� 60
Shape Attributes����������������������������������������������������������������������������������������������������������������������������������� 66
Shape Styles����������������������������������������������������������������������������������������������������������������������������������������� 67
vi
■ Table of Contents
Drawing Images������������������������������������������������������������������������������������������������������������� 69
Drawing Text������������������������������������������������������������������������������������������������������������������� 70
Loading and Creating Fonts������������������������������������������������������������������������������������������������������������������ 70
Text Attributes��������������������������������������������������������������������������������������������������������������������������������������� 73
Scaling Text������������������������������������������������������������������������������������������������������������������������������������������ 73
Renderers in Processing������������������������������������������������������������������������������������������������ 75
The PShape Class����������������������������������������������������������������������������������������������������������� 76
Creating PShapes��������������������������������������������������������������������������������������������������������������������������������� 76
Loading Shapes from SVG�������������������������������������������������������������������������������������������������������������������� 79
Texturing Shapes���������������������������������������������������������������������������������������������������������������������������������� 81
Summary������������������������������������������������������������������������������������������������������������������������ 82
■
■Chapter 5: Touchscreen Interaction��������������������������������������������������������������������� 83
Touch Events in Android������������������������������������������������������������������������������������������������� 83
Basic Touch Events������������������������������������������������������������������������������������������������������������������������������� 83
Multi-touch Events������������������������������������������������������������������������������������������������������������������������������� 89
Touch-Based Interaction������������������������������������������������������������������������������������������������ 93
Item Selection��������������������������������������������������������������������������������������������������������������������������������������� 93
Scrolling����������������������������������������������������������������������������������������������������������������������������������������������� 95
Swipe and Pinch����������������������������������������������������������������������������������������������������������������������������������� 97
vii
■ Table of Contents
Summary���������������������������������������������������������������������������������������������������������������������� 126
■
■Part III: Sensors������������������������������������������������������������������������������ 127
■
■Chapter 7: Reading Sensor Data������������������������������������������������������������������������ 129
Sensors in Android Devices������������������������������������������������������������������������������������������ 129
Accelerometer������������������������������������������������������������������������������������������������������������������������������������ 129
Gyroscope������������������������������������������������������������������������������������������������������������������������������������������� 130
Magnetometer������������������������������������������������������������������������������������������������������������������������������������ 130
Location���������������������������������������������������������������������������������������������������������������������������������������������� 130
Summary���������������������������������������������������������������������������������������������������������������������� 140
■
■Chapter 8: Driving Graphics and Sound with Sensor Data�������������������������������� 141
Using Ketai to Read Sensor Data���������������������������������������������������������������������������������� 141
Measuring Acceleration������������������������������������������������������������������������������������������������ 141
Shake Detection��������������������������������������������������������������������������������������������������������������������������������� 142
Step Counter��������������������������������������������������������������������������������������������������������������������������������������� 143
Audio-visual Mapping of Step Data���������������������������������������������������������������������������������������������������� 144
Playing Audio�������������������������������������������������������������������������������������������������������������������������������������� 149
viii
■ Table of Contents
Summary���������������������������������������������������������������������������������������������������������������������� 162
■
■Chapter 9: Geolocation�������������������������������������������������������������������������������������� 163
Location Data in Android���������������������������������������������������������������������������������������������� 163
Using Location API in Processing��������������������������������������������������������������������������������� 164
Location Permissions������������������������������������������������������������������������������������������������������������������������� 165
Accessing Data from Multiple Threads����������������������������������������������������������������������������������������������� 167
Location with Ketai����������������������������������������������������������������������������������������������������������������������������� 171
Using Additional Location Data����������������������������������������������������������������������������������������������������������� 172
Summary���������������������������������������������������������������������������������������������������������������������� 182
■
■Part IV: Wearables and Watch Faces���������������������������������������������� 183
■
■Chapter 10: Wearable Devices��������������������������������������������������������������������������� 185
From Activity Trackers to Smartwatches���������������������������������������������������������������������� 185
Smartwatches������������������������������������������������������������������������������������������������������������������������������������ 186
Summary���������������������������������������������������������������������������������������������������������������������� 195
ix
■ Table of Contents
■
■Chapter 11: Visualizing Time����������������������������������������������������������������������������� 197
From Sundials to Smartwatches���������������������������������������������������������������������������������� 197
Using Time to Control Motion������������������������������������������������������������������������������������������������������������� 198
Square vs. Round Watch Faces���������������������������������������������������������������������������������������������������������� 200
Summary���������������������������������������������������������������������������������������������������������������������� 235
■
■Part V: 3D and Shaders������������������������������������������������������������������� 237
■
■Chapter 13: 3D in Processing���������������������������������������������������������������������������� 239
The P3D Renderer�������������������������������������������������������������������������������������������������������� 239
Hello World in 3D�������������������������������������������������������������������������������������������������������������������������������� 239
x
■ Table of Contents
xi
■ Table of Contents
■
■Part VI: Extended Reality: VR and AR��������������������������������������������� 303
■
■Chapter 16: Basics of VR����������������������������������������������������������������������������������� 305
Brief History of VR�������������������������������������������������������������������������������������������������������� 305
Google Cardboard������������������������������������������������������������������������������������������������������������������������������� 305
Hardware Requirements��������������������������������������������������������������������������������������������������������������������� 306
VR in Processing���������������������������������������������������������������������������������������������������������� 306
Stereo Rendering�������������������������������������������������������������������������������������������������������������������������������� 307
Monoscopic Rendering����������������������������������������������������������������������������������������������������������������������� 309
VR Interaction��������������������������������������������������������������������������������������������������������������� 310
Eye and World Coordinates����������������������������������������������������������������������������������������������������������������� 311
The Line of Sight��������������������������������������������������������������������������������������������������������������������������������� 313
Selecting a Shape with Screen Coordinates��������������������������������������������������������������������������������������� 315
Bounding Box Selection���������������������������������������������������������������������������������������������������������������������� 318
Summary���������������������������������������������������������������������������������������������������������������������� 328
■
■Chapter 17: Basics of AR����������������������������������������������������������������������������������� 329
A Brief History of AR����������������������������������������������������������������������������������������������������� 329
AR on Android������������������������������������������������������������������������������������������������������������������������������������� 330
Requirements������������������������������������������������������������������������������������������������������������������������������������� 331
Getting Started����������������������������������������������������������������������������������������������������������������������������������� 331
xii
■ Table of Contents
■
■Chapter 18: Creating XR Experiences���������������������������������������������������������������� 351
Challenges with XR Apps���������������������������������������������������������������������������������������������� 351
Drawing in VR������������������������������������������������������������������������������������������������������������������������������������� 352
Initial Sketches����������������������������������������������������������������������������������������������������������������������������������� 353
Summary���������������������������������������������������������������������������������������������������������������������� 373
■
■Part VII: Appendixes����������������������������������������������������������������������� 375
■
■Chapter 19: Appendix A: Gradle and Android Studio Integration���������������������� 377
Google Tools for Android Development������������������������������������������������������������������������� 377
Exporting a Sketch As a Gradle Project������������������������������������������������������������������������ 379
Importing into Android Studio�������������������������������������������������������������������������������������� 380
Adding a Processing Sketch to a Layout���������������������������������������������������������������������� 384
■
■Chapter 20: Appendix B: Processing Libraries for Android������������������������������� 389
Extending Processing with Libraries���������������������������������������������������������������������������� 389
Installing Libraries with the Contribution Manager���������������������������������������������������������������������������� 389
Installing Libraries Manually�������������������������������������������������������������������������������������������������������������� 392
Index��������������������������������������������������������������������������������������������������������������������� 397
xiii
About the Author
xv
About the Technical Reviewer
xvii
Other documents randomly have
different content
Fig. 49.—Old
(degenerated)
trichina cyst.
(Colin.)
ARTICULAR RHEUMATISM.
MUSCULAR RHEUMATISM.