如何启动GL_Painter
我希望任何人都可以帮助我开始用 OpenGL 做这个程序 编写一个OpenGL程序(交互式程序),通过单击起点来绘制线条,然后在显示窗口绘图区域上拖动。 为用户提供一个菜单供他选择。该菜单包含以下选项: 1- 清除显示窗口。 2- 选择至少包含以下颜色(红、绿、蓝、黑)的线条画颜色。 3- 选择一种线条图案,其中包括(短划线、点线、点划线、实线)。 4- 选择线条粗细。 (线宽从 1 到 4)。 5-退出程序。
I Hope that any one could help me to start doing this program in OpenGl
Write an OpenGL program (interactive program) that draw lines by clicking on the start point and then drag on the display window drawing area.
Give the user a menu that (s)he choose from. The menu contains the following options:
1- Clearing the display window.
2- Choose a line drawing color which includes at least the colors (red, green, blue, black).
3- Choose a line pattern which includes (dash, dot, dot-dash, solid lines).
4- Choose a line thickness. (line width from 1 to 4).
5- Quit the program.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
AntTweakBar 不错简约的 GUI 库,它与 OpenGL 很好地集成(并且您不需要太多代码)。
FreeGLUT 将有利于窗口和鼠标处理它的代码也很少。
OpenGL。
glBegin 可用于绘制线条。
glCorol 可用于颜色(选择颜色使用 AntTweakBar)。
如果您需要更多帮助更新问题(您可能无权添加评论,但您可以编辑您的问题)。
PS 从问题中我假设你是初学者,因此我的回答水平。如果你愿意的话我可以更深入。
PSPS 你不需要 OpenGL 来做这种事情,但我认为 OpenGL 是一个要求,对吗?否则还有更简单的解决方案。还要澄清一下你的问题(特别是关于画线的部分,你允许非直线吗?)。
AntTweakBar is good minimalistic gui library and it integrate well with OpenGL (and you do not need much code).
FreeGLUT will be good for windowing and mouse handling and it is also little code.
OpenGL.
glBegin can be used for drawing lines.
glCorol can be used for color (for choosing color use AntTweakBar).
If you need more help update question (you probably do not have rights to add comments, but you can edit your question).
PS From question I've draw assumption that you are beginner, hence level of my answer. I can go deeper if you like.
PSPS You do not need OpenGL to do this kind of stuff, but I assume that OpenGL is a requirement, right? Otherwise there are simpler solutions. Also clarify your question a bit (aspecially section about drawing lines, do you allow non-straight lines?).