简体   繁体   English

使用OpenGL使用C ++制作3D橱柜图像

[英]Use of OpenGL to make 3D Cupboard Image using C++

I have to draw cupbaord image like below using visual studio c++ by using OpenGL and I dont have much of an idea on how to do this. 我必须通过使用OpenGL使用Visual Studio C ++来绘制如下所示的cupbaord图像,但我对如何执行此操作没有太多想法。 Where should I start? 我应该从哪里开始?

橱柜

Lets assume for a short moment that the cupboard should be 2 dimensional (I cant believe that your teacher wants you to start 3d development without giving you an introduction first). 让我们暂时假设橱柜应该是二维的(我不敢相信您的老师希望您在不首先介绍您的情况下开始3d开发)。 This simplifies things alot. 这简化了很多事情。 While you could also draw 2d shapes with OpenGL or DirectX I wouldnt recommend you any of those frameworks, as these have a steep learning curve especially for a beginner. 虽然您也可以使用OpenGL或DirectX绘制2d形状,但我不建议您使用任何这些框架,因为这些框架的学习曲线特别陡峭,特别适合初学者。

It would have been nice to know, whether you (and your class) have worked with a specific GUI framework before. 很高兴知道您(和您的班级)以前是否曾使用过特定的GUI框架。 If not Im afraid to tell you that you will have to get into one. 如果不是,我很害怕告诉你,你将不得不融入其中。 QT is one of the most commonly used in C++ and I would advice you to you this one, as it provides a clean abstraction and you wont have to deal with kind of lowlevel functions like they appear in win32. QT是C ++中最常用的一种,我会向您建议这个,因为它提供了一种清晰的抽象,并且您将不必像在Win32中出现的那样处理一些低级函数。

Nonetheless which one you choose, nearly every has some component allowing you to draw arbitrary (2D) stuff. 无论选择哪种,几乎每个组件都有一些组件可以让您绘制任意(2D)的东西。 In QT this is done by implementing a custom Widget. 在QT中,这是通过实现自定义窗口小部件来完成的。 Here is a tutorial on this matter: http://www.informit.com/articles/article.aspx?p=1174421&seqNum=2 这是有关此问题的教程: http : //www.informit.com/articles/article.aspx?p= 1174421& seqNum=2

As I assume that your cupboard should actually be a more or less fancy grid I can assure you that this is kind of simple. 因为我认为您的橱柜实际上应该是一个或多或少的花哨的网格,所以我可以向您保证,这很简单。 A little hint: rectengular polygons and for loops. 一个小提示:矩形多边形和for循环。

I weakly recommend the classic 'NeHe' tutorials http://nehe.gamedev.net/ they demonstrate some poor code but do the job and are popular enough that you can find help with them specifically 我强烈推荐经典的“ NeHe”教程http://nehe.gamedev.net/,它们演示了一些较差的代码,但确实能胜任工作,并且非常受欢迎,因此您可以从中找到专门的帮助。

Tackle it like any problem too... you can make an app? 也可以解决任何问题...您可以制作一个应用程序吗? so you know you need an entry point, right? 所以您知道您需要一个入口点,对吗? You want to show an image? 您要显示图像吗? Load it into memory etc.... google become much more helpful for those kinds of targeted problems. 加载到内存等。...谷歌变得更加有用的那些针对性的问题。 :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM