今天作的函式化的繪圖function
void rect(float ax,float ay,float bx,float by, float cx,float cy,float dx, float dy,float R,float G,float B)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(R,G,B);
glBegin(GL_POLYGON);
glVertex2f(ax,ay);
glVertex2f(bx,by);
glVertex2f(cx,cy);
glVertex2f(dx,dy);
glEnd();
}
void pt(float x,float y,float Size,float R,float G, float B)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(R,G,B);
glPointSize (Size);
glBegin(GL_POINTS);
glVertex2f(x,y);
glEnd();
}
沒有留言:
張貼留言