Professional Documents
Culture Documents
h>
#include <math.h>
#include <GL/glut.h>
#include "drawplant.h"
// commented out until you implement it
// #include "myMatrix.h"
#include <stdio.h>
int ITER=0; //number of iterations to go thru
glMatrixMode(GL_MODELVIEW);
glLoadMatrixf(M3D);
}
void drawLeaf(void) {
glColor3f(0.1,0.9,0.1);
glBegin(GL_POLYGON);
glVertex2f(0.0,0.0);
glVertex2f(1.0,0.7);
glVertex2f(1.3,1.8);
glVertex2f(1.0,2.8);
glVertex2f(0.0,4.0);
glVertex2f(-1.0,2.8);
glVertex2f(-1.3,1.8);
glVertex2f(-1.0,0.7);
glEnd();
}
void drawPlant(void) {
load2DMatrix(sqrt(3.0)/2.0, -1.0/2.0,
0.0,
1.0/2.0,
sqrt(3.0)/2.0, 4.0,
0.0,
0.0,
1.0);
drawLeaf();
}