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: commented Main.cpp · posted by vaibhav bhawsar 389 days ago
The commented file:
main.txt
CompuForm Assigment 1: grid · posted by vaibhav bhawsar 389 days ago
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();
}
CompuForm Assigment 1: landscape · posted by vaibhav bhawsar 389 days ago
void drawLand ( void )
{
float c = .00392;
//glPolygonMode(GL_BACK,GL_LINE);
glBegin(GL_QUADS);
glColor3f(c*164,c*164,c*164);
glVertex2f(0,windowW);
glColor3f(c*60,c*95,c*105);
glVertex2f(0,windowH/2);
glVertex2f(windowW,windowH/2);
glColor3f(c*224,c*224,c*224);
glVertex2f(windowW,windowH);
glEnd();
// //
glBegin(GL_QUADS);
glColor3f(c*0,c*60,c*60);
glVertex2f(0,windowH/2);
glColor3f(c*66,c*105,c*60);
// //
glVertex2f(0,0);
glVertex2f(windowW,0);
glColor3f(c*66,c*105,c*60);
glVertex2f(windowW,windowH/2);
glEnd();
// //
float x = 40;
//hill1
glBegin(GL_TRIANGLES);
glColor3f(c*60,c*80,c*60);
glVertex2f(x+60,windowH/2+(70)+(mouseY/3));
glColor3f(c*16,c*105,c*60);
glVertex2f(x+180,windowH/2);
glColor3f(c*0,c*60,c*60);
glVertex2f(x,windowH/2);
glEnd();
// //
//hill3
glBegin(GL_TRIANGLES);
glColor3f(c*60,c*80,c*60);
glVertex2f(x+490,windowH/2+(120)+(mouseY/6));
glVertex2f(x+600,windowH/2);
glColor3f(c*0,c*60,c*60);
glVertex2f(x+190,windowH/2);
glEnd();
// //
//hill2
glBegin(GL_TRIANGLES);
glColor3f(c*60,c*80,c*60);
glVertex2f(x+190,windowH/2+(100)+(mouseY/6));
glVertex2f(x+300,windowH/2);
glColor3f(c*0,c*60,c*60);
glVertex2f(x+100,windowH/2);
glEnd();
// //
//hill4
glBegin(GL_TRIANGLES);
glColor3f(c*60,c*80,c*60);
glVertex2f(x+590,windowH/2+(70)+(mouseY/3));
glColor3f(c*16,c*105,c*60);
glVertex2f(x+690,windowH/2);
glColor3f(c*0,c*60,c*60);
glVertex2f(x+490,windowH/2);
glEnd();
// //
//cloud
float f = mouseX*.318/(255);
glBegin(GL_TRIANGLE_FAN);
glColor4f(c*53,c*230,c*233,mouseX*.318/(255));
glVertex2f(161,507);
glVertex2f(161,523);
glVertex2f(174,527);
glVertex2f(187,523);
glColor4f(c*10,c*150,c*233,mouseX*.318/(255));
glVertex2f(195,515);
glVertex2f(191,497);
glVertex2f(179,487);
glVertex2f(174,487);
glVertex2f(161,495);
glVertex2f(151,488);
glVertex2f(144,487);
glVertex2f(140,492);
glVertex2f(135,492);
glVertex2f(129,495);
glVertex2f(128,501);
glColor4f(c*53,c*230,c*233,mouseX*.318/(255));
glVertex2f(133,508);
glVertex2f(139,512);
glVertex2f(151,519);
glVertex2f(161,523);
glEnd();
// //
//river
float xr = windowW/2+(mouseX);
float yr = windowH/2;
glColor4f(c*53,c*230,c*233,.1);
glBegin(GL_TRIANGLE_STRIP);
//left
glVertex2f(windowW/2-(10),windowH/2);
//right
glVertex2f(windowW/2+40,windowH/2);
glVertex2f(windowW/2-(xr/5),yr-20);
glVertex2f(xr,yr-10);
glVertex2f(windowW/2-(xr/4.5),yr-40);
glVertex2f(xr,yr-20);
glVertex2f(windowW/2-(xr/4.3),yr-50);
glVertex2f(xr+20,yr-60);
glVertex2f(windowW/2-(xr/4),yr-60);
glVertex2f(xr+40,yr-80);
glVertex2f(windowW/2-(xr/3.5),yr-80);
glVertex2f(xr+60,yr-100);
glVertex2f(windowW/2-(xr/3),yr-100);
glVertex2f(xr+80,yr-120);
glVertex2f(windowW/2-(xr/2.5),yr-120);
glVertex2f(xr+100,yr-140);
glVertex2f(windowW/2-(xr/2),yr-140);
glVertex2f(xr+120,yr-160);
glVertex2f(windowW/2-(xr/1.5),yr-160);
glVertex2f(xr+140,yr-180);
glVertex2f(windowW/2-(xr),60);
glVertex2f(xr+180,0);
glVertex2f(windowW/2-(xr),0);
glEnd();
}
CompuForm Assigment 1: portrait · posted by vaibhav bhawsar 389 days ago
void drawPortrait( void )
{
//glPolygonMode(GL_BACK,GL_LINE);
glBegin(GL_TRIANGLE_FAN);
glColor3f(.4,.4,.4);
glVertex2f(400,285);
glVertex2f(380,93);
glVertex2f(360,130);
glVertex2f(338,168);
glVertex2f(310,176);
glVertex2f(272,180);
glVertex2f(260,183);
glVertex2f(253,190);
glVertex2f(251,198);
glVertex2f(253,207);
glVertex2f(254,218);
glVertex2f(250,226);
glVertex2f(243,230);
glVertex2f(240,236);
glVertex2f(243,241);
glVertex2f(246,246);
glVertex2f(238,249);
glVertex2f(232,255);
glVertex2f(234,265);
glVertex2f(241,280);
glVertex2f(231,287);
glVertex2f(227,295);
glVertex2f(227,303);
glVertex2f(231,312);
glVertex2f(242,324);
glVertex2f(252,336);
glVertex2f(262,362);
glVertex2f(264,375);
glVertex2f(259,391);
glVertex2f(270,421);
glVertex2f(281,444);
glVertex2f(301,461);
glVertex2f(344,486);
glVertex2f(386,500);
glVertex2f(424,501);
glVertex2f(455,491);
glVertex2f(495,455);
glVertex2f(521,420);
glVertex2f(521,420);
glVertex2f(532,346);
glVertex2f(528,320);
glVertex2f(521,310);
glVertex2f(518,289);
glVertex2f(512,266);
glVertex2f(511,239);
glVertex2f(519,182);
glVertex2f(522,150);
glVertex2f(500,129);
glVertex2f(461,102);
glVertex2f(415,88);
glVertex2f(398,87);
glVertex2f(380,93);
glEnd();
// //
//eyes
glBegin(GL_TRIANGLE_STRIP);
glColor3f(.2,.2,.2);
glVertex2f(270,357);
glVertex2f(273,364);
glVertex2f(272,348);
glVertex2f(278,364);
glVertex2f(277,346);
glVertex2f(282,363);
glVertex2f(282,349);
glVertex2f(286,361);
glVertex2f(287,352);
glVertex2f(288,360);
glVertex2f(290,356);
glEnd();
}


