Developing Graphics Frameworks with Python and OpenGL

Developing Graphics Frameworks with Python and OpenGL

Developing Graphics Frameworks with Python and OpenGL

Developing Graphics Frameworks with Python and OpenGL

Hardcover

$130.00 
  • SHIP THIS ITEM
    Qualifies for Free Shipping
  • PICK UP IN STORE
    Check Availability at Nearby Stores

Related collections and offers


Overview

Developing Graphics Frameworks with Python and OpenGL shows you how to create software for rendering complete three-dimensional scenes. The authors explain the foundational theoretical concepts as well as the practical programming techniques that will enable you to create your own animated and interactive computer-generated worlds.

You will learn how to combine the power of OpenGL, the most widely adopted cross-platform API for GPU programming, with the accessibility and versatility of the Python programming language. Topics you will explore include generating geometric shapes, transforming objects with matrices, applying image-based textures to surfaces, and lighting your scene. Advanced sections explain how to implement procedurally generated textures, postprocessing effects, and shadow mapping. In addition to the sophisticated graphics framework you will develop throughout this book, with the foundational knowledge you will gain, you will be able to adapt and extend the framework to achieve even more spectacular graphical results.


Product Details

ISBN-13: 9780367721800
Publisher: CRC Press
Publication date: 07/07/2021
Pages: 344
Product dimensions: 6.12(w) x 9.19(h) x (d)

About the Author

Lee Stemkoski is a professor of mathematics and computer science. He earned his Ph.D. in mathematics from Dartmouth College in 2006 and has been teaching at the college level since. His specialties are computer graphics, video game development, and virtual and augmented reality programming.

Michael Pascale is a software engineer interested in the foundations of computer science, programming languages, and emerging technologies. He earned his B.S. in Computer Science from Adelphi University in 2019. He strongly supports open source software and open access educational resources.

Table of Contents

Authors ix

Chapter 1 Introduction to Computer Graphics 1

1.1 Core Concepts and Vocabulary 2

1.2 The Graphics Pipeline 8

1.2.1 Application Stage 9

1.2.2 Geometry Processing 10

1.2.3 Rasterization 12

1.2.4 Pixel Processing 14

1.3 Setting Up a Development Environment 17

1.3.1 Installing Python 17

1.3.2 Python Packages 19

1.3.3 Sublime Text 21

1.4 Summary and Next Steps 23

Chapter 2 Introduction to Pygame and OpenGL 25

2.1 Creating Windows with Pygame 25

2.2 Drawing a Point 32

2.2.1 OpenGL Shading Language 32

2.2.2 Compiling GPU Programs 36

2.2.3 Rendering in the Application 42

2.3 Drawing Shapes 46

2.3.1 Using Vertex Buffers 46

2.3.2 An Attribute Class 49

2.3.3 Hexagons, Triangles, and Squares 51

2.3.4 Passing Data between Shaders 59

2.4 Working with Uniform Data 64

2.4.1 Introduction to Uniforms 64

2.4.2 A Uniform Class 65

2.4.3 Applications and Animations 67

2.5 Adding Interactivity 77

2.5.1 Keyboard Input with Pygame 77

2.5.2 Incorporating with Graphics Programs 80

2.6 Summary and Next Steps 81

Chapter 3 Matrix Algebra and Transformations 83

3.1 Introduction to Vectors and Matrices 83

3.1.1 Vector Definitions and Operations 84

3.1.2 Linear Transformations and Matrices 88

3.1.3 Vectors and Matrices in Higher Dimensions 98

3.2 Geometric Transformations 102

3.2.1 Scaling 102

3.2.2 Rotation 103

3.2.3 Translation 109

3.2.4 Projections 112

3.2.5 Local Transformations 119

3.3 A Matrix Class 123

3.4 Incorporating with Graphics Programs 125

3.5 Summary and Next Steps 132

Chapter 4 A Scene Graph Framework 133

4.1 Overview of Class Structure 136

4.2 3D Objects 138

4.2.1 Scene and Group 141

4.2.2 Camera 142

4.2.3 Mesh 143

4.3 Geometry Objects 144

4.3.1 Rectangles 145

4.3.2 Boxes 147

4.3.3 Polygons 150

4.3.4 Parametric Surfaces and Planes 153

4.3.5 Spheres and Related Surfaces 156

4.3.6 Cylinders and Related Surfaces 158

4.4 Material Objects 164

4.4.1 Base Class 165

4.4.2 Basic Materials 166

4.5 Rendering Scenes with the Framework 172

4.6 Custom Geometry and Material Objects 177

4.7 Extra Components 184

4.7.1 Axes and Grids 185

4.7.2 Movement Rig 188

4.8 Summary and Next Steps 192

Chapter 5 Textures 193

5.1 A Texture Class 194

5.2 Texture Coordinates 201

5.2.1 Rectangles 202

5.2.2 Boxes 202

5.2.3 Polygons 203

5.2.4 Parametric Surfaces 204

5.3 Using Textures in Shaders 206

5.4 Rendering Scenes with Textures 212

5.5 Animated Effects with Custom Shaders 215

5.6 Procedurally Generated Textures 221

5.7 Using Text in Scenes 228

5.7.1 Rendering Text Images 228

5.7.2 Billboarding 232

5.7.2.1 Look-At Matrix 232

5.7.2.2 Sprite Material 236

5.7.3 Heads-Up Displays and Orthogonal Cameras 241

5.8 Rendering Scenes to Textures 247

5.9 Postprocessing 254

5.10 Summary and Next Steps 265

Chapter 6 Light and Shadow 267

6.1 Introduction to Lighting 268

6.2 Light Classes 271

6.3 Normal Vectors 274

6.3.1 Rectangles 274

6.3.2 Boxes 275

6.3.3 Polygons 276

6.3.4 Parametric Surfaces 276

6.4 Using Lights in Shaders 280

6.4.1 Structs and Uniforms 280

6.4.2 Light-Based Materials 282

6.5 Rendering Scenes with Lights 291

6.6 Extra Components 295

6.7 Bump Mapping 298

6.8 Bloom and Glow Effects 302

6.9 Shadows 312

6.9.1 Theoretical Background 312

6.9.2 Adding Shadows to the Framework 317

6.10 Summary and Next Steps 328

Index 331

From the B&N Reads Blog

Customer Reviews