![]()
#include <GL/glut.h> typedef GLfloat point2[2]; point2 v[]={ {-1.0,-0.58},{1.0,-0.58},{0.0,1.15}}; int n; void mydisplay() { glClear(GL_COLOR_BUFFER_BIT); glColor3f(0.5,0.5,0.4); glBegin(GL_LINE); glVertex2d(-0.5,-0.5); glVertex2d(-0.5,0.5); glVertex2d(0.5,0.5); glVertex2d(0.5,-0.5); glEnd(); glFlush(); } void triangle(point2 a,point2 b,point2 c) { //glBegin(GL_TRIANGLES); glVertex2fv(a); glVertex2fv(b); glVertex2fv(c); //glEnd(); } void divide_triangle(point2 a,point2 b,point2 c,int m) { point2 v0,v1,v2; int j; if(m>0) { for (j=0;j<2;j
【OpenGL】细分三角形
最新推荐文章于 2020-12-26 16:11:42 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)