Cara membuat robot sederhana di OpenGL
Berikut merupakan script lengkap membuat robot : #include <windows.h> #include <stdlib.h> #include <glut.h> void aa(void) { glClear( GL_COLOR_BUFFER_BIT); glBegin(GL_POLYGON); glColor3ub(0, 0, 255); glVertex2i(-50,200); glVertex2i(-50,100); glVertex2i(100,100); glVertex2i(100,200); glEnd(); glBegin(GL_TRIANGLES); glColor3ub(255,0,0); glVertex2i(100,180); glVertex2i(100,250); glVertex2i(110,200); glEnd(); glBegin(GL_TRIANGLES); glColor3ub(255,0,0); glVertex2i(-50,180); glVertex2i(-50,250); glVertex2i(-60,200); glEnd(); glBegin(GL_POLYGON); glColor3ub(255,255,255); glVertex2i(-25,180); glVertex2i(75,180); glVertex2i(75,160); glVertex2i(-25,160); glEnd(); glLineWidth(10); glBegin(GL_LINES); glColor3ub(255,0,0); glVertex2i(