Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mathematics for Game Programming and Computer Graphics

You're reading from   Mathematics for Game Programming and Computer Graphics Explore the essential mathematics for creating, rendering, and manipulating 3D virtual environments

Arrow left icon
Product type Paperback
Published in Nov 2022
Publisher Packt
ISBN-13 9781801077330
Length 444 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Penny de Byl Penny de Byl
Author Profile Icon Penny de Byl
Penny de Byl
Arrow right icon
View More author details
Toc

Table of Contents (26) Chapters Close

Preface 1. Part 1 – Essential Tools
2. Chapter 1: Hello Graphics Window: You’re On Your Way FREE CHAPTER 3. Chapter 2: Let’s Start Drawing 4. Chapter 3: Line Plotting Pixel by Pixel 5. Chapter 4: Graphics and Game Engine Components 6. Chapter 5: Let’s Light It Up! 7. Chapter 6: Updating and Drawing the Graphics Environment 8. Chapter 7: Interactions with the Keyboard and Mouse for Dynamic Graphics Programs 9. Part 2 – Essential Trigonometry
10. Chapter 8: Reviewing Our Knowledge of Triangles 11. Chapter 9: Practicing Vector Essentials 12. Chapter 10: Getting Acquainted with Lines, Rays, and Normals 13. Chapter 11: Manipulating the Light and Texture of Triangles 14. Part 3 – Essential Transformations
15. Chapter 12: Mastering Affine Transformations 16. Chapter 13: Understanding the Importance of Matrices 17. Chapter 14: Working with Coordinate Spaces 18. Chapter 15: Navigating the View Space 19. Chapter 16: Rotating with Quaternions 20. Part 4 – Essential Rendering Techniques
21. Chapter 17: Vertex and Fragment Shading 22. Chapter 18: Customizing the Render Pipeline 23. Chapter 19: Rendering Visual Realism Like a Pro 24. Index 25. Other Books You May Enjoy

Hello Graphics Window: You’re On Your Way

Students new to games and computer graphics fall into two camps: ones that think mathematics is a real bore and of no real use, and others that realize it is akin to breathing. The fact is that if you want to be successful (and stay alive) in the domain, then you can’t deny the importance of mathematics. This doesn’t mean that learning about it should be a grind. What we find most exciting about teaching and learning about mathematics in the computer games and graphics space is that the equations and numbers come alive through visual representations that remain otherwise unseen in other fields. Throughout this book, you will learn the essential mathematics in games and graphics by exploring the theory surrounding each topic and then utilizing it in real-world applications.

To this end, throughout this book, you will not only gain an understanding of the essential mathematics that is used throughout games and graphics, but also apply its principles in one of today’s hottest programming languages: Python.

Note

As the content of this book relates to both computer graphics and computer games, rather than continually typing out the laborious phrase “computer graphics and computer games,” we will endeavor to refer to both collectively as graphics.

“Why Python?” we hear you ask. “Why not some fancy game’s engine?” Well, besides having Python programming as a great skill under your belt when it comes to applying for a job, Python with the assistance of PyCharm (our Integrated Development Environment – IDE), Pygame (a graphics interface), and PyOpenGL (a Python/OpenGL API) reveals much of the underlying technical processes hidden by game engines and brings you face to face with direct calls to the graphics APIs that access OpenGL and DirectX. It’s a more challenging way to learn about mathematics if you remove all the high-level methods available to you that hide how your applied mathematics programming skills are working.

Learning about the mathematics of computer games and graphics at this level is essential in your learning journey. In this ever-changing domain, as technology progresses, your theoretical level of the how’s and why’s of the topic can remain constant and make you a highly skilled and adaptive programmer. A deep-seated knowledge of the algorithms and equations running the APIs of contemporary games and graphics engines is critical and transferable knowledge that developers can take from one platform to another and from one API to another. It not only provides extra insight while troubleshooting and debugging, but also gives a programmer an intuitive understanding of what functionality an API might contain without actually knowing that API. It’s akin to understanding all the tools in Adobe Photoshop and being able to perceive what tools will be available in Affinity Photo without ever using it. Having good math skills blurs the line between what is possible and what is not.

Now that you know why you are learning about mathematics in the way presented throughout this book, it’s time to dive into getting your own development environment set up and exploring the anatomy of a simple graphics window that will become the basis of all our exercises moving forward. We will begin with a guided exercise in getting your own development environment setup using PyCharm. This will allow you to jump right into coding with as little fuss as possible. It removes the need to manually download and install packages and plugins that usually require knowledge of command-line install procedures, which can become laborious and vary between desktop machine setups. This means more time spent on coding to start using Python to open windows and explore the range of fundamental graphics drawing methods that will set you up for graphics development success.

In this chapter, we will cover the following topics:

  • Getting Started with Python, PyCharm, and Pygame
  • Creating a Basic Graphics Window
  • Working with Window and Cartesian Coordinates
You have been reading a chapter from
Mathematics for Game Programming and Computer Graphics
Published in: Nov 2022
Publisher: Packt
ISBN-13: 9781801077330
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime