如何开始图形编程?
我是一个编程菜鸟; (a) 基本的 C++ 技能和 (b) 计算编程方面的良好技能(尽管这可能没有多大帮助)。 我想生成我有数据集的犹他州茶壶。我已经阅读了 NeHe 教程,但我真的很想亲自动手。那么您能告诉我如何将 OpenGL 与 Dev C++ 结合使用吗?我知道 Visual C++(NeHe 建议的)要方便得多,但是,正如我之前提到的,我想稍微粗略一下。 非常感谢,祝你有愉快的一天。
I'm a programming noob with;
(a) Basic C++ skills and
(b) Fair skills in computational programming (though that might not be of great help).
I want to generate the Utah teapot for which I have the data set. I have read the NeHe tutorials, but I really want to get my hands dirty. So could you please tell me how to use OpenGL with Dev C++. I know Visual C++ (suggested by NeHe) is far more convenient, however, as I have mentioned earlier, I want to rough it a bit.
Thanks a lot and have a nice day.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您是否在亲自动手时遇到问题,或者在将 OpenGL 与 Dev C++ 结合使用时遇到问题?
如果您想快速学习 OpenGL(亲自动手),那么只需选择一个简单的项目并开始执行即可。渲染一个带纹理的立方体。根据箭头输入旋转立方体。渲染高度图。在高度图上渲染一个立方体,该立方体根据箭头输入四处走动。用空格键让它跳跃。现在您基本上已经掌握了游戏的基础,您所需要的只是导入模型。了解如何导入模型并让 OpenGL 理解它们。
如果您只是在 Dev C++ 方面遇到问题,那么我会听听每个人告诉您的内容,然后使用其他内容!我认为您可以免费获得 Visual C++ Express 版本,特别是如果您是大学学生(大多数人都会订阅某种学生 MSDN)。或者正如其他人所建议的那样,Code::Blocks 是一个很棒的免费替代方案。
Are you having issues with getting your hands dirty, or having issues with using OpenGL with Dev C++?
If you want to learn OpenGL quickly (get your hands dirty) then simply pick a simple project and just DO it. Render a textured cube. Spin the cube based on arrow input. Render a heightmap. Render a cube on the heightmap that walks around based on arrow input. Make it jump with the space bar. Now you've essentially got the basis for a game, all you need is to import a model. Learn how to import models and get OpenGL to understand them.
If you're just having issues with Dev C++, then I would listen to what every one is telling you and use something else!. I think you can get a visual C++ express version for free, especially if you are a student at a University (most will have some sort of student MSDN subscription). Or as others have suggested, Code::Blocks is a great, free alternative.
如果您想考虑将Eclipse作为一个选项,我写了一篇关于如何设置Eclipse来开发OpenGL(以及GLUT< /strong>)Windows 和 Mac OS X 中的 C/C++ 和 Java 应用程序。如果您有兴趣,这可能是一个起点。
它包含准备好系统所需的所有步骤和所有信息。
您可以在这里找到它:
设置 Eclipse 来开发 OpenGL 和 OpenGL Java 和 Java 中的过多应用程序Windows 上的 C/C++ MAC OS X!
If you want to consider Eclipse as an option, I wrote an article about how to setup Eclipse to develop OpenGL (and GLUT) applications in C/C++ and Java in both Windows and Mac OS X. This could be a starting point if you are interested.
It contains all the steps and all you need to know to have the system ready.
You can find it here:
Setup Eclipse to develop OpenGL & GLUT apps in Java & C/C++ on Windows & MAC OS X!
不用担心它会变得粗糙。您将进行图形编程,这并不意味着谦虚,这将足够粗糙,但不会妨碍您自己。
善待自己,在 Windows 上使用 Visual C++。
如果您想搞砸,请仅使用 OpenGL Core 配置文件,并编写您自己的着色器。现在这是一种有用的肮脏的方式,一旦你克服了砖墙学习曲线,世界就是你的牡蛎。
首先渲染出现的顶点。稍后,您可以编写一个几何着色器将它们渲染为贝塞尔点,正如它们的预期一样。
Don't worry about roughing it up. You'll be programming graphics which -with no implied modesty- is going to be rough enough without handicapping yourself.
Treat yourself and get Visual C++ is you're on windows.
If you want to get dirty, use only the OpenGL Core profile, and write your own shaders. Now that's a useful kind of dirty, and once you get past the brick wall learning curve, the world's your oyster.
Start with rendering the vertices as they appear. Later, you could write a geometry shader to render them as bezier points, as they were intended.