#include "letters.h" #define RAD 3.14159/180; void draw_o() { //Keep track because to draw the 'O', we will //use scaling to stretch the circle into an ellipse glPushMatrix(); //Move to the center glTranslated(0.5, 0.5, 0); //Strech the circle into an ellipse in the y-direction glScaled(1, 1.25, 1); //Draw the circle glBegin(GL_LINE_LOOP); double radius = 0.4; int i; double angle; for ( i = 0; i < 360; i++) { angle = i * RAD; glVertex2d(cos(angle)*radius, sin(angle)*radius); } glEnd(); //Return to initial matrix glPopMatrix(); //Move for next letter glTranslated(1,0,0); } void draw_O(){draw_o();} void draw_e() { glBegin(GL_LINES); glVertex2d(0.1, 0); glVertex2d(0.1, 1); glVertex2d(0.1, 0); glVertex2d(0.7, 0); glVertex2d(0.1, 1); glVertex2d(0.7, 1); glVertex2d(0.1,0.5); glVertex2d(0.5,0.5); glEnd(); //Move for next letter. glTranslated(0.8,0,0); } void draw_E(){draw_e();} void draw_y() { glTranslated(-0.3,0,0); glBegin(GL_LINES); glVertex2d(0.4,0); glVertex2d(0.9,1); glVertex2d(0.65, 0.5); glVertex2d(0.4,1); glEnd(); //Move for next letter glTranslated(1,0,0); } void draw_Y(){draw_y();}