改进代码void dispiay(float a,float b,float len){ glBegin(GL_POLYGON); glVertex2f(a,b); glVertex2f(a+len,b); glVertex2f(a+len,b-len); glVertex2f(a,b-len); glEnd();}
时间: 2023-05-28 22:08:04 浏览: 63
void display(float a, float b, float len) {
glBegin(GL_POLYGON);
glVertex2f(a, b);
glVertex2f(a + len, b);
glVertex2f(a + len, b - len);
glVertex2f(a, b - len);
glEnd();
}
改进说明:原代码中的 a len 应该改为 a + len 以表达长度的意思。
相关推荐
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![doc](https://img-home.csdnimg.cn/images/20210720083327.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
![xlsx](https://img-home.csdnimg.cn/images/20210720083732.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pptx](https://img-home.csdnimg.cn/images/20210720083543.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![xlsx](https://img-home.csdnimg.cn/images/20210720083732.png)