Homework 6 |
Modified: |

typedef struct {
GLfloat ambient[4];
GLfloat diffuse[4];
GLfloat specular[4];
GLfloat shininess;
} materialStruct;
Hints
void writeText3fStroke(GLfloat x, GLfloat y, char text[], GLfloat size)
{
glPushMatrix();
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glOrtho(-1,1,-1,1,-1,1);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(x,y,0);
glScalef(size,size,size);
for (unsigned int i=0; i<strlen(text); i++)
glutStrokeCharacter(GLUT_STROKE_ROMAN,
(int)text[i]);
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
}
