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

问题描述

让我的小行星克隆(C语言),我宁愿爱上了基于矢量的实体,但我只是codeD,并将其作为X,Y点阵列。这一直是罚款,类似小行星,但我应该怎么做,如果我想要更复杂的二维模型?

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.

不过,我宁愿更感兴趣的是创建2D矢量为基础的模型比3D,因为我非常高兴能继续努力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文件,然后使用的导入和渲染他们。那会很好地工作,或者你有其他的建议?

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的后端preferably)。

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.

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

08-15 02:36