如何使用过剩绘制完整的绘画 [英] How can I draw a full painting using glut
问题描述
我想通过使用opengl的过剩来做这个绘画,但是我无法弄清楚我已经尝试了很多但我无法解决的解决方案
设计一个允许用户绘制任何一个的应用程序对象如下:
基于在点模式下按下P或p对象。
基于按下'L'或'l'对象呈现在线模式。
基于按多边形模式渲染的'G'或'g'对象。
使用箭头键在相对方向上平移对象(向上,向右,向下和向左)。
使用鼠标按钮激活菜单,包括以下内容:
- 转换
缩放
旋转
- 物体颜色
样本颜色
- 背景颜色
样本颜色
- 退出(结束程序执行)
我尝试过:
http://textuploader.com/5boot
http://textuploader.com/5boo0
http://textuploader.com/5book
我会开始查看像 http://www.mitchr.me/SS/exampleCode/glut.html [ ^ ] - 他有一些非常好的例子,同样这个例子 http://www.cs.ucsb.edu/~nurmi/cs60/project4/basic.cpp [ ^ ]& 使用2D图形介绍OpenGL - OpenGL教程 [ ^ ]
既然你已经发布了代码,那么没有人可以说你自己的努力与你的距离有多远 - 这也让人怀疑你实际做了什么,不幸的是 - 我们不做为人们做作业/作业 - 不要害怕在这里发布你自己的代码,无论你认为它有多糟糕 - 确定有人喜欢批评,但大多数人都在这里提供帮助 - 我曾经写过的一些代码回来的时候,我很尴尬地发布自己:-)
我的建议是,从'hello word'开始,添加和扩展功能,以及在需要详细帮助时,使用代码发回特定问题。
ps ..如果你在CP上搜索c ++过剩,你也可以找到一些文章: -
GLUT窗口模板 [ ^ ]
OpenGL和GLUT:强大的图形库和实用工具包 [ ^ ]
I want to do this painting by using the glut from opengl, but I can not figure out the solution I have tried a lot but I cant
Design an application that allows user to draw an any object as follows:
Based on pressing ‘P’ or ‘p’ object rendered in a point mode.
Based on pressing ‘L’ or ‘l’ object rendered in a line mode.
Based on pressing ‘G’ or ‘g’ object rendered in a polygon mode.
use the arrow keys to translate the object in a relative direction (up, right, down, and left).
use the mouse button to activate a menu the include the following:
- Transformation
scaling
rotation
- Object color
sample colors
- Background color
sample color
- Quit (to end execution of the program)
What I have tried:
http://textuploader.com/5boot
http://textuploader.com/5boo0
http://textuploader.com/5book
I would start looking at things like http://www.mitchr.me/SS/exampleCode/glut.html[^] - he has some really good examples, ditto this example http://www.cs.ucsb.edu/~nurmi/cs60/project4/basic.cpp[^] & An introduction on OpenGL with 2D Graphics - OpenGL Tutorial[^]
Since you havnt posted code, no-one can really say how far off the mark you are with your own efforts - it also makes people suspicious that you havnt actually done anything, unfortunately - and we dont do homework/assignments for people - dont be afraid of posting your own code here, no matter how bad you think it is - sure there are people who love to criticise, but most people are here to help - some of the code I used to write way back when I'd be so embarrassed to post myself :-)
My advice is, start with 'hello word', add and extend functionality to it, and post back specific questions with code when you need detailed help.
ps .. if you do a search here on CP for c++ glut you also find some articles :-
GLUT Window Template[^]
The OpenGL and GLUT: A Powerful Graphics Library and Utility Kit[^]
这篇关于如何使用过剩绘制完整的绘画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!