A simple opengl c++ program that show triangle of different color rotates along the axis.
Rajeev
Dual Rotating Triangle
In VTU 6th Sem Syllabus COMPUTER GRAPHICS AND VISUALIZATION Lab, Student have to do a project using the OpenGL and C++. Many of the student have made a great mark by submitting some good projects like 3D Animated Robot . Many of student want to have simple program, hence today we have came with very simple program for you.
Dual Rotating Triangle
As you may understand with the name of project, there is two triangle and they are rotating. We have used the simple code for developing this project. Let start doing it.
First we have defined a global variable for angle.
int GAngle=0;
The whole program is divided into three parts - Display, Timer and Main. We will code each of them one by one.
First We will define the Display Function, where we are going to use simple primitive opengl function for drawing triangle GL_TRIANGLE. We use the global GAngle variable to rotate the drawn triangle. You can experiment with the angle and try how it turn out to be. You can also experiments with t…