Table of Contents
Preface xiii
Part 1 – Essential Tools
1
Hello Graphics Window: You’re On Your Way 3
Technical requirements4
Getting Started with Python, PyCharm, and Pygame5
Creating a Basic Graphics Window8
Working with Window and Cartesian Coordinates14
Let’s do it…15
Your Turn…19
Summary19
Answers20
2
Let’s Start Drawing 21
Technical requirements22
Color22
Let’s do it…23
Your turn…25
Lines25
Let’s do it…25
Your turn…26
Let’s do it…27
Text29
Let’s do it…31
Your turn…32
Polygons33
Let’s do it…34
Your turn…35
Raster Images35
Let’s do it…36
Summary38
Answers38
3
Line Plotting Pixel by Pixel 41
Technical requirements41
The Naïve Way: Drawing a line with brute force42
Let’s do it…43
Enter Bresenham: The improved approach45
Let’s do it…47
Get Mathematics for Game Programming and Computer Graphics now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.