用于游戏开发的二维矢量建模 [英] 2D vector modelling for game development

查看:34
本文介绍了用于游戏开发的二维矢量建模的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

制作我的小行星克隆(在 C 中)我更喜欢基于矢量的实体,但我只是将它们编码为 x,y 点数组.对于 Asteroids 之类的东西来说这很好,但是如果我想制作更复杂的 2D 模型该怎么办?

Making my Asteroids clone (in C) I've rather fallen in love with vector-based entities, but I've simply coded them in as x,y-point arrays. That's been fine for something like Asteroids, but what should I do if I want to make more complex 2D models?

我注意到有 大量的 3D 建模软件,如以及将 3D 模型导入 C/C++ 程序以与 Open GL 配合使用的大量教程和帮助.

I note that there is an awful lot of 3D modelling software out there, as well as ample tutorials and help on importing 3D models into one's C/C++ program for use with Open GL.

不过,与 3D 相比,我对创建基于矢量的 2D 模型更感兴趣,因为我很高兴能继续尝试 2D 游戏一段时间.是否存在二维建模这样的概念?是否有用于创建和导出 2D 模型的工具和专门用于导入 2D 模型的库,还是只是在 3D 软件中创建平面模型然后导入这些文件(例如 .3ds、.ms3d)并将它们平放在 z 轴上?

However I'm rather more interested in creating 2D vector-based models than 3D, as I'm perfectly happy to keep trying 2D games for a while yet. Does such a concept as 2D modelling exist? Are there tools for creating and exporting 2D models and libraries for importing 2D models specifically, or does one just create flat models in 3D software and then import those files (e.g. .3ds, .ms3d) and lay them flat onto the z-axis?

到目前为止我唯一的想法可能是使用诸如 Inkscape 之类的东西进行建模,生成 SVG 文件,然后使用Cairo 以导入和渲染它们.这会奏效吗,或者您有其他建议吗?

My only thought so far was perhaps using something like Inkscape for modelling, generate SVG files, and then use Cairo to import and render them. Will that work well, or do you have other recommendations?

请注意,我对任何类型的建模都是新手,所以我可能会问一个愚蠢的问题......

Note I'm a bit of a newbie to modelling of any kind, so I may be asking a silly question...

推荐答案

就 2D 矢量游戏编程而言,它通常是 Flash 和 Flex 的领域.

As far as 2D vector game programming goes, it usually is the domain of Flash and Flex.

仍然 SVG 并通过开罗加载它似乎是一个可行的解决方案.虽然我会注意确保您启用了硬件加速(最好是 OpenGL 后端).

Still SVG and loading it via Cairo seems to be a viable solution. Although I'd take care to make sure that you have hardware acceleration enabled (OpenGL backend preferably).

就 2D 格式而言,您不会获得对任何格式的 SVG 那样好的支持,所以我会坚持使用它.从技术上讲,像 Collada 或 X3D 这样的东西确实支持 2D 图形,但实际上它们有很多无用的(对于 2D 程序员)膨胀.

As far as 2D formats go, you won't get as good support as for SVG for any format, so I'd stick with it. Technically things like Collada or X3D do support 2D graphics, but practically they have a lot of useless (for a 2D programmer) bloat.

这篇关于用于游戏开发的二维矢量建模的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆