computational form (22),
everybityoumake (12),
play (12),
information (11),
atoz (10),
processingtext (10),
nime (9),
mobility (8),
thesis (8),
fabricatinginformation (7),
interactivesound (7),
mapping (6),
locative (5),
fall2007 (4),
ubicomp (4),
blah (3),
isco (3),
pcomp (3),
assistive technologies (1),
design thinking (1)
CompuForm Assigment 1: grid · posted by vaibhav bhawsar Sep 14, 06:40
void drawGrid ( void )
{
//the color of the line
glColor3f(.8,.8,.8);
//draw lines
glBegin(GL_LINES);
//horizontal line
for(int h = 0 ; h < windowH/10 ; h++ ){
glVertex2f ( 0 , h*10 );
glVertex2f ( windowW , h*10 );
//vertical lines
for(int v = 0 ; v < windowW/10 ; v++ ){
glVertex2f(v*10 , windowH );
glVertex2f(v*10 , 0);
}
}
glEnd();
//draw points
glColor3f(.4,.4,.4);
glPointSize(3);
glBegin(GL_POINTS);
int numberOfDivisions = 10;
for(int h = 0 ; h <= windowH/numberOfDivisions ; h++){
for(int v = 0 ; v <= windowW/numberOfDivisions ; v++){
glVertex2f(v*numberOfDivisions, h*numberOfDivisions);
}
}
glEnd();
}
Commenting is closed for this article.
CompuForm Assigment 1: landscape CompuForm Assigment 1: commented Main.cpp


