OpenGL 平滑多边形
我试图使用 OpenGL 使其成为一个平滑的多边形,但它没有做任何事情。有人可以解释一下我做错了什么吗?
glColor4ub(r, g, b, a);
glEnable(GL_POLYGON_SMOOTH);
glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);
glBegin(GL_QUADS);
glVertex2i(x, y);
glVertex2i(x1, y1);
glVertex2i(x2, y2);
glVertex2i(x3, y3);
glEnd();
glDisable(GL_POLYGON_SMOOTH);
glHint(GL_POLYGON_SMOOTH_HINT, GL_DONT_CARE);
提前致谢!
I am trying to make this a smooth polygon using OpenGL, but it is not doing anything. Can someone please explain what I am doing wrong?
glColor4ub(r, g, b, a);
glEnable(GL_POLYGON_SMOOTH);
glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);
glBegin(GL_QUADS);
glVertex2i(x, y);
glVertex2i(x1, y1);
glVertex2i(x2, y2);
glVertex2i(x3, y3);
glEnd();
glDisable(GL_POLYGON_SMOOTH);
glHint(GL_POLYGON_SMOOTH_HINT, GL_DONT_CARE);
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这种平滑渲染的方法已经过时了。最好将多重采样与 GL_ARB_multisample 扩展一起使用。
This method to smooth rendering is way out of date. It would be better to use multisampling with the GL_ARB_multisample extension.