有没有一种简单的方法可以使用C ++在openGL中绘制圆圈? [英] Is there a simple way to draw a circle in openGL using C++?

查看:71
本文介绍了有没有一种简单的方法可以使用C ++在openGL中绘制圆圈?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我希望有人可以帮我画一个简单的2d圈或openGL。我在网上找不到任何简单的教程,我刚开始使用openGL。如果有人能帮我找到一个好的教程或引导我朝着正确的方向前进,我将非常感谢!

Hi,

I'm hoping if anyone can help me draw a simple 2d circle or hoop in openGL. I can't find any simple tutorials online and I'm just starting out with openGL. If anyone could help me find a good tutorial or lead me in the right direction I would greatly appreciate it!

推荐答案

这里展示了如何绘制一个 2D circle: OpenGL中的2D绘图 [ ^ ]。我知道它是 Basic4GL ,但是您可以轻松地将圆绘图代码转换为 C ++ 并将其插入其中一个许多 C ++ / OpenGL 可用的骨架项目。
Here is shown how to draw a 2D circle: 2D Drawing in OpenGL[^]. I know it is Basic4GL, however you could easily convert the circle drawing code to C++ and insert it in one of the many C++/OpenGL skeleton projects available.


有很多方法可以在openGL中绘制圆圈使用过的点或者只是使用了这些线条,即使你想用自己的方式去。



由于圈数可以通过不定点或线路使用
There are many way you can draw circles in openGL Used points or just used the lines even you can wish to go with your own way.

As circle can be made from indefinite points or line use
GL_POINTS

GL_LINES

坐标到径向格式(极坐标)为



with changing the coordinate to radial format (polar coordinate) as

x=r*sin(theta)-h

y =r*cos(theta)+k


这篇关于有没有一种简单的方法可以使用C ++在openGL中绘制圆圈?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆