Perspective projection demo

This is an implementation of the perspective projection equations. We use them to project the vertices of a cube, and then draw line segments between these, to render a wireframe cube.

We use the same color for the edges of each face of the cube. Because each edge is shared by two faces, the color you see depends on the order in which we draw them.

Computer Graphics From Scratch · Dedication | Acknowledgements | Table of Contents | Introduction | Introductory Concepts
Part I: Raytracing · Basic Raytracing | Light | Shadows and Reflections | Extending the Raytracer
Part II: Rasterization · Lines | Filled Triangles | Shaded Triangles | Perspective Projection | Describing and Rendering a Scene | Clipping | Hidden Surface Removal | Shading | Textures | Extending the Rasterizer
Appendixes · Linear Algebra | Afterword