computational form 23,
play 14,
information 13,
everybityoumake 12,
atoz 10,
processingtext 10,
mapping 9,
mobility 9,
nime 9,
fabricatinginformation 8,
interactivesound 7,
locative 7,
thesis 7,
ubicomp 5,
blah 4,
thinking 4,
isco 3,
pcomp 3,
assistive technologies 1,
howto 1,
visualization 1
CompuForm Assigment 1: grid · posted by vaibhav bhawsar Sep 14, 2007
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.
Previous: CompuForm Assigment 1: landscape Next: CompuForm Assigment 1: commented Main.cpp


