Lessons 01 - 05

Lesson01 screenshot

Setting Up An OpenGL Window

In this tutorial, I will teach you how to set up, and use OpenGL in a Windows environment. The program you create in this tutorial will display an empty OpenGL window, switch the computer into fullscreen or windowed mode, and wait for you to press ESC or close the Window to exit. It doesn't sound like much, but this program will be the framework for every other tutorial I release in the next while. It's very important to understand how OpenGL works, what goes into creating an OpenGL Window, and how to write simple easy to understand code. You can download the code at the end of the tutorial, but I definitely recommend you read over the tutorial at least once, before you start programming in OpenGL.
Lesson02 Screenshot

Your First Polygon

Using the source code from the first tutorial, we will now add code to create a Triangle, and a Square on the screen. I know you're probably thinking to yourself "a triangle and square... oh joy", but it really is a BIG deal. Just about everything you create in OpenGL will be created out of triangles and squares. If you don't understand how to create a simple little triangle in Three Dimensional space, you'll be completely lost down the road. So read through this chapter and learn.  


Once you've read through this chapter, you should understand the X axis, Y axis and Z axis. You will learn about translation left, right, up, down, into and out of the screen. You should understand how to place an object on the screen exactly where you want it to be. You will also learn a bit about the depth buffer (placing objects into the screen). 

Lesson 03 Screenshot

Adding Color

Expanding on the second tutorial I will teach you how to create spectacular colors in OpenGL with very little effort. You will learn about both flat coloring and smooth coloring. The triangle on the left uses smooth coloring. The square on the right is using flat coloring. Notice how the colors on the triangle blend together.  

Color adds alot to an OpenGL project. By understanding both flat and smooth coloring, you can greatly enhance the way your OpenGL demos look. 

Lesson 04 Screenshot

Rotation

Moving right along. In this tutorial I'll teach you how to rotate both the triangle and the quad. The triangle will rotate on the Y axis, and the quad will rotate on the X axis. This tutorial will introduce 2 variables. rtri is used to store the angle of the triangle, and rquad will store the angle of the quad.  

It's easy to create a scene made up of polygons. Adding motion to those object makes the scene come alive. In later lessons I'll teach you how to rotate an object around a point on the screen causing the object to move around the screen rather than spin on its axis. 

Lesson 05 Screenshot

3D Shapes

Now that we have setup, polygons, quads, colors and rotation figured out, it's time to build 3D objects. We'll build the objects using polygons and quads. This time we'll expand on the last tutorial, and turn the triangle into a colorful pyramid, and turn the square into a solid cube. The pyramid will use blended colors, the cube will have a different color for each face.  

Building an object in 3D can be very time consuming, but the results are usually worth it. Your imagination is the limit!