Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
[email protected] webmail now available. Want one? Go here.
Cannot use outlook/hotmail/live here to register as they blocking our mail servers. #microsoftdeez
Obey the Epel!

Paste

Pasted as C by hellyeah ( 14 years ago )
//GLintPoint Class
class GLintPoint
{
public:
int x,y;
GLintPoint(int a, int b)
{x=a,y=b;}

};

void parametrizedHouse(GLintPoint peak,GLint width,GLint height)
{
GLint ChWidth = width/50;
GLint DoorWidth = width/10;
GLint DoorHeight= height/10;
GLint WindowW= width/10;
GLint WindowH= height/10;
//Skeleton of the House
glBegin(GL_LINE_LOOP);
glVertex2i((GLint)peak.x,peak.y);

GLintPoint secondPoint((GLint)peak.x+width/2, (GLint)peak.y-3*height/8);
glVertex2i(secondPoint.x,secondPoint.y);

GLintPoint thirdPoint((GLint)peak.x+width/2, (GLint)peak.y-height);
glVertex2i(thirdPoint.x,thirdPoint.y);

GLintPoint fourthPoint((GLint)peak.x-width/2,(GLint)peak.y-height);
glVertex2i(fourthPoint.x,fourthPoint.y);

GLintPoint fifthPoint((GLint)peak.x-width/2,(GLint)peak.y-3*height/8);
glVertex2i(fifthPoint.x,fifthPoint.y);
glEnd();
//Chimeney of the house
glBegin(GL_LINE_STRIP);
glVertex2i(((peak.x+fifthPoint.x)/2)-ChWidth, ((peak.y+fifthPoint.y)/2)-ChWidth);
glVertex2i(((peak.x+fifthPoint.x)/2)-ChWidth,peak.y);
glVertex2i(((peak.x+fifthPoint.x)/2)+ChWidth,peak.y);
glVertex2i(((peak.x+fifthPoint.x)/2)+ChWidth,((peak.y+fifthPoint.y)/2)+ChWidth);
glEnd();
//Door of the House
glBegin(GL_LINE_STRIP);
glVertex2i(((thirdPoint.x+fourthPoint.x)/2)-DoorWidth,fourthPoint.y);
glVertex2i(((thirdPoint.x+fourthPoint.x)/2)-DoorWidth,fifthPoint.y-DoorHeight);
glVertex2i(((thirdPoint.x+fourthPoint.x)/2)+DoorWidth,fifthPoint.y-DoorHeight);
glVertex2i(((thirdPoint.x+fourthPoint.x)/2)+DoorWidth,fourthPoint.y);
glEnd();
//Window of the House
glBegin(GL_LINE_LOOP);
glVertex2i(((thirdPoint.x+((thirdPoint.x+fourthPoint.x)/2)+DoorWidth)/2)-WindowW,fifthPoint.y-DoorHeight);
glVertex2i(((thirdPoint.x+((thirdPoint.x+fourthPoint.x)/2)+DoorWidth)/2)-WindowW,fifthPoint.y-DoorHeight+WindowH);
glVertex2i(((thirdPoint.x+((thirdPoint.x+fourthPoint.x)/2)+DoorWidth)/2)+WindowW,fifthPoint.y-DoorHeight+WindowH);
glVertex2i(((thirdPoint.x+((thirdPoint.x+fourthPoint.x)/2)+DoorWidth)/2)+WindowW,fifthPoint.y-DoorHeight);
glEnd();
glFlush();
}

 

Revise this Paste

Parent: 18201
Children: 18203
Your Name: Code Language: