Apr 26, 2025
TRIANGLES!!!
Today while at work I spent most of my breaks, lunch and free time reading ahead in the LearnOpenGL guide and I learned a lot and was excited to get home and start programming. However, once I got home and began I soon realized that the way the guide is set up isn’t the best way for me to learn. The code is in blocks and I don’t know where it should go. Inside the main function? At the top of the file? I couldn’t figure that out… So I found the Github repo for the LearnOpenGL Guide.
Next I found and started following a tutorial I found on YouTube and it’s been really good. This tutorial is really showing me how the elements all work together but I will admit I skipped over some videos in the series that were more of lecture style about the math involved in dealing with 3D space and objects.
It was much easier to follow the tutorial with the knowledge I gained from reading through the guide ahead of time and I will more than likely continue reading through the guide even if I’m following other tutorials because it will all make sense and the pieces will all fall into place.
This was the first tutorial I started with.

Following the tutorial I was able to render my first Triangle in C++!

Then we output 3 different colors and the shaders interpolate between them.

And a square which is just two triangles.
A GPU’s favorite shape is a triangle!

and here we made 2 different shaders for each triangle!
that’s all for now!