Gambar diatas adalah hasil outputnya,
Berikut adalah syntax yang digunakan :
#include<stdlib.h>
#include<glut.h>
int w=480, h=480, z=-20;
int x1=0, y1=0, sudut=0, z1=0, skalaX=0, skalaY=0;
void renderScene(void){
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glClearColor(1,1,1,1);
glLoadIdentity();
glTranslatef(0,0,z);
glRotatef(sudut,x1,y1,z1);
//kaki kanan
glPushMatrix();
glRotatef(-20,1,0,-1);
glTranslatef(-1.9,-4,0);
glColor3f(0.8,0.55,0.3);
glScalef(1,2.5,1);
glutSolidCube(1.3);
glPopMatrix();
glPushMatrix();
glRotatef(-20,1,0,-1);
glTranslatef(-1.901,-4.01,0.01);
glColor3f(0,0,0);
glScalef(1,2.5,1);
glutWireCube(1.3);
glPopMatrix();
//sepatu
glPushMatrix();
glRotatef(-20,1,0,-1);
glTranslatef(-1.9,-5,0);
glColor3f(0,0.5,1);
glScalef(1.2,1,1.5);
glutSolidCube(1.3);
glPopMatrix();
//kaki kiri
glPushMatrix();
glRotatef(20,1,0,1);
glTranslatef(0,-4,0);
glColor3f(0.8,0.55,0.3);
glScalef(1,2.5,1);
glutSolidCube(1.3);
glPopMatrix();
glPushMatrix();
glRotatef(20,1,0,1);
glTranslatef(0.01,-4.01,0.01);
glColor3f(0,0,0);
glScalef(1,2.5,1);
glutWireCube(1.3);
glPopMatrix();
//sepatu
glPushMatrix();
glRotatef(20,1,0,1);
glTranslatef(0,-5,0);
glColor3f(0,0.5,1);
glScalef(1.2,1,1.5);
glutSolidCube(1.3);
glPopMatrix();
//badan
glPushMatrix();
glTranslatef(0,0,0);
glColor3f(0.8,0.6,0.3);
glScalef(2,3,2);
glutSolidCube(2);
glPopMatrix();
glPushMatrix();
glTranslatef(0,0,0);
glColor3f(0,0,0);
glScalef(2.01,3.01,2.01);
glutWireCube(2);
glPopMatrix();
//bendera
glPushMatrix();
glTranslatef(1,0,1.52);
glColor3f(1,0,0);
glScalef(1.3,0.5,1);
glutSolidCube(1);
glPopMatrix();
glPushMatrix();
glTranslatef(1,-0.5,1.53);
glColor3f(1,1,1);
glScalef(1.3,0.5,1);
glutSolidCube(1);
glPopMatrix();
//nomor punggung
glPushMatrix();
glTranslatef(0,0,-1.53);
glColor3f(1,1,1);
glScalef(1.3,0.5,1);
glutSolidCube(1);
glPopMatrix();
glPushMatrix();
glRotatef(30,0,0,1);
glTranslatef(-0.7,-0.73,-1.53);
glColor3f(1,1,1);
glScalef(0.5,2.5,1);
glutSolidCube(1);
glPopMatrix();
//tangan kanan
glPushMatrix();
glRotatef(110,1,0,0);
glTranslatef(-2.7,2.3,0);
glColor3f(0.8,0.55,0.3);
glScalef(1,3,1);
glutSolidCube(1.3);
glPopMatrix();
glPushMatrix();
glRotatef(110,1,0,0);
glTranslatef(-2.701,2.301,0.01);
glColor3f(0,0,0);
glScalef(1,3,1);
glutWireCube(1.3);
glPopMatrix();
Tutorial vektor "Hope" style Obama menggunakan Photoshop.