Easy Drawing OpenGL
glutInitWindowPosition(100,100);
glutInitWindowSize(640,480);
Creating windows with size (640.480) with the upper-left point of the window is placed at the position (100.100) on the computer screen.
glutCreateWindow(“Drawing By Rachman Ardyansyah");
Entitled to the windows with "Drawing By Rachman Ardyansyah".
glVertex2i(x,y)
To draw a point at position (x, y) where x and y is defined as an integer.
glVertex2f(x,y)
To draw a point at position (x, y) where x and y are defined as fractions (float / double).
glBegin(GL_LINES);
glVertex2i(100,100);
glVertex2i(200,150);
glEnd();
To create a line of libraries required by state GL_LINES starting point and end point of the line.
glBegin(GL_LINE_STRIP);
glVertex2i(x1,y1);
glVertex2i(x2,y2);
glVertex2i(x3,y3);
……………………………………………
glVertex2i(xn,yn);
glEnd();
Polyline is a set of lines that are connected to each other to form an object image.
glColor3f(red,green,blue);
glColor3f(0.0.0.);//black
glColor3f(0.0.1.);//blue
glColor3f(0.1.0.);//green
glColor3f(0.1.1.);//cyan
glColor3f(1.0.0.);//red
glColor3f(1.0.1.);//magenta
glColor3f(1.1.0.);//yellow
Tinting on OpenGL using color combinations with colors based on RGB (Red, Green, Blue).