关于如何使用 OpenGL/GLUT 建模建筑物的想法?

发布于 2024-11-03 02:30:29 字数 223 浏览 7 评论 0原文

我是图形学新手,我必须仅使用 GLUT 或 OpenGL 为作业制作一个建筑物模型。

基本上要制作校舍的模型(仅外部部分),但我不知道从哪里开始。到目前为止,我已经使用 GLUT 绘制了多边形和其他形状,但没有绘制有多个形状的东西。到目前为止,所有的绘图都是使用线、点、多边形和数学。

您能给我一个如何去做的想法吗?

更新:我只是想知道我可以采取哪些步骤来完成它。一些参考链接会很棒!

I'm new to graphics, and I have to make a model of a building for an assignment using only GLUT or OpenGL.

Basically the school building's model( only the exterior portion) is to be made, and I have no clue where to start. Upto now I have drawn polygons, other shapes using GLUT, nothing in which there are multiple shapes. All the drawing upto now is using lines, or points, or polygons and mathematics.

Could you please give me an idea of how to go about it?

Update: I just want to know what steps I can follow to get it done. Some reference links would be awesome!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

等风来 2024-11-10 02:30:29

您可以使用建模程序来创建模型,然后使用 COLLADA 等工具将您的模型导入 OpenGL。

You could use modeling programs to create your model, and then use tools such as COLLADA to get your model into OpenGL.

嗳卜坏 2024-11-10 02:30:29

手动编码这样的复杂对象的问题在于,仅仅定义对象的顶点就需要大量代码行。

人们通常使用 3D 建模软件来构建复杂的 3D 对象,例如 Maya、3DSMax 或 Blender,然后以可读取到 OpenGL 应用程序的格式导出它们。

The problem with hand-coding a complex object like that is that it takes a great number of lines of code just to define the vertices of the object.

People usually use 3D modeler software to build complex 3D objects, like Maya, 3DSMax or Blender and then export them in a format to be read into your OpenGL application.

悲歌长辞 2024-11-10 02:30:29

想想你希望你的建筑是什么样子,并想想你需要渲染什么样的三角形才能实现这一目标。您可以在某种建模软件中绘制整个事物,然后将其导入 OpenGL,或者您可以自己提出三角形/纹理并在 OpenGL 中手动完成。

建筑物的外部可能会有类似的纹理(砖块等),然后会有窗户、门和屋顶。也许是某种写着“校舍”的标志。考虑到这一切,你到底想要你的建筑是什么样子,然后想想你需要什么纹理来绘制这些东西。

例如,假设您正在建造一座盒子形状的砖砌建筑,带有一扇门和几扇窗户。我会为砖块使用一种纹理,然后首先绘制整面砖墙。然后,我会为窗户使用灰色/蓝色的纹理,并将其绘制在砖墙上。然后我会对门做同样的事情(不同的纹理)。

只需考虑设计,然后进行尝试 - 实验。祝你好运!

Think about what you want your building to look like, and think about what kind of triangles you need to render in order to make that. You can either draw the entire thing in some sort of modelling software, and then import it into OpenGL, or you can come up with the triangles/textures yourself and do it by hand in OpenGL.

The exterior of the building will probably have a similar texture on the whole thing (brick, etc), and then there will be windows, doors, and a roof. Maybe some sort of sign that says "School Building". Take this all into account, what exactly you want your building to look like, and then think about what textures you will need to draw these things.

For example, say you're doing a brick building that is in the shape of a box, with a door and a few windows. I'd use one texture for the brick, and first draw an entire wall of brick. Then, I'd use a grey/blue looking texture for the window, and draw it over the brick wall. Then I'd do the same (different texture) for the door.

Just think about the design, and then just try things out - experiment. Good luck!

坏尐絯℡ 2024-11-10 02:30:29

我曾经有过一个类似的作业。我通过使用 Google SketchUp 创建模型,然后将模型导出到 .3ds 文件并使用我的程序来渲染它来做到这一点。
我选择 Google SketchUp,因为它是我尝试过的工具中最容易使用的。另外,他们还为学生提供折扣。您还可以使用 Blender,它是免费的,但需要花费太多时间来学习恕我直言。 3dsMax 太贵了,无法支付家庭作业费用。
为了将模型加载到我的程序中,我使用了 Assimp 库。

I once had a simillar homework. I did it by creating the models with Google SketchUp, then export the models to .3ds file and use my program to render it.
I choose Google SketchUp because it's the easiest to use among those tool I tried. Plus, they had a discount for students. You could also use Blender, which is free but take too much time to learn IMHO. 3dsMax is too expensive to pay for a homework.
To load the model into my program, I used Assimp library.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文