iklan

Thursday, February 10, 2011

MY FIRST ASSIGNMENT THIS SEMESTER

today 10.02.11..
its thursday!!...

for the first time ever....i submit my assignment a week earlier...hahaha...
i never done that...either submit at the the very end or don't submit at all...hehehe
my first assignment this semester...Computer Graphic....hehehe

This is some of the question....its kinda long so i just put the first paragraph...

Implement a simple 2D ‘paint’ program using OpenGL and GLUT, with the following OpenGL primitives:

-GL_POINTS

-GL_LINES

-GL_LINE_LOOP

-GL_TRIANGLES

-GL_QUADS

this is my some of my answers

//=================================header============================//

#include
#include
#include


//================================declare==========================//

#define RED 1
#define GREEN 2
#define BLUE 3
#define WHITE 4
#define QUAD 5
#define LINE 6
#define POINT 7
#define TRIANGLE 8
#define CLEAR 9
#define CIRCLE 10
#define CIRCLE2 11
#define QUAD2 12
#define TRIANGLE2 13
#define BLACK 14
#define CYAN 15
#define MAGENTA 16
#define YELLOW 17
#define EXIT 18
#define POINTSIZE1 19
#define POINTSIZE2 20
#define POINTSIZE3 21
#define POINTSIZE4 22
#define POINTSIZE5 23
#define POINTSIZE6 24


//==========declare global variable==================//

int point_size;
float R=0,G=0,B=0;
int X1=-1, X2=-1, X3=-1, Y1=-1, Y2=-1, Y3=-1, DX, DY, rad, LastX,LastY;
bool P1= false,P2=false, P3= false, Cleared = false, Cleared2 = false, Quad=false,
Quad2=false,Line=false, Point=false, Triangle=false,Triangle2=false ,
Circle = false, Circle2=false, checked=false, Text=false;
char *shape="No Shape Selected";


its a bit long so this is the outcome....

the main menu

right click

ahmad endo - araplah pas sem tuk....

3 comments:

Anisa Hang Tuah said...

waah..pekebende tuu
heee
pape pun.all the best yer endo

MIMIE AIZA said...

errrkkk.. macam mane nak paham tu. cikgu terangkan. heeee

CripsyCaiHong said...

my course is maths and computer graphic but im terrible in it!
whoa
u can do it

awesome