Returning to OpenGL, we dive into perspective rendering. Previously, we’ve rendered a single square in a flat plane, but to draw a scene that looks three dimensional to our brains, we’ll need to get more complex and start mimicking how our eyeballs perceive the world.
After going through the math, we sketched out a clean-room implementation for drawing a cube in perspective based on the WebGL2 Fundamentals examples. Stick around to the end of the video to see one heck of a red-and-black spinning cube.
Notes/highlights:
- If you’re interested in going deep with the math, check out Essential Mathematics for Games and Interactive Applications: A Programmer’s Guide (https://www.amazon.com/Essential-Mathematics-Games-Interactive-Applications/dp/0123742978)
- Read more about the perspective divide here - it’s super interesting! https://www.learnopengles.com/tag/perspective-divide/
- As before, our WebGL2 state visualizer is https://webgl2fundamentals.org/webgl/lessons/resources/webgl-state-diagram.html
- Miro (https://miro.com) is our multi-platform whiteboard solution du jour, and it was pretty nice!