Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

OpenGL Triangle Basics

0.00/5 (No votes)
20 Jul 2002 2  
A little dialog example showing you the basic movements of an OpenGL triangle.

Sample Image - openglstruct.jpg

Basic triangle movement in OpenGL (Beginner introduction to OpenGL)

OpenGL is an API for 3D programmers to create three dimensional looking objects and animate them. It is used in games, 3D animation, 3D drawing applications, etc. The bottom line is that every 3D object is constructed out of triangles. These triangles are created by specifying three points in space which each have three coordinates (x, y and z axis). OpenGL makes this easy for you by providing a function for this which accepts the coordinates of these points in space (called a vertex) and creates surfaces out of them (called polygons). This way, programmers can create entire three dimensional worlds and complex objects. OpenGL also provides the programmer with complex filters to give the objects a different look (shading, transparency, smoothing, ...).

Some notes regarding the demo project

I wrote this compact dialog application because I actually just wanted to put an OpenGL frame into a dialog. I am aware there are probably similar projects out there but this one was entirely written by me with some help of OpenGL programming sites. I remember spending a long time programming this because I was just beginning to program in C (so there's probably some weird code in it, but it works). The project is a Dev-C++ project but can easily be converted to a VC++ project. (Dev-C++ available here as a free IDE which uses the Mingw compiler for C). I suggest you just create an empty project in VC++ and add the .cpp, .h and resource file, and check for some IDE specifics (such as the icon which is not available in VC++), or download and install Dev-C++ (it's free and it works great, so... why not?).

I have not specialized in OpenGL or 3D programming in general, I just know the basics.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here