Java 用于开发导入器的示例 COLLADA 文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1028848/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 22:25:55  来源:igfitidea点击:

Sample COLLADA files for development of an importer?

java3dfile-formatblendercollada

提问by Ricket

I'm preparing to write a COLLADA importer in Java. There aren't any pre-written importers, and even if there were I would probably be picky, so I believe this is best. I am going with COLLADA 1.4 because I do not need the 1.5 features, and many programs don't yet support it. I found the specfor it and plan on following it, but it is much easier to follow by example and reference the spec for additional information.

我正准备用 Java 编写一个 COLLADA 导入器。没有任何预先编写的进口商,即使有我也可能会很挑剔,所以我相信这是最好的。我将使用 COLLADA 1.4,因为我不需要 1.5 的特性,而且许多程序还不支持它。我找到了它的规范并计划遵循它,但是通过示例来遵循并参考规范以获取更多信息要容易得多。

So with all that... Can some of you who are experienced in COLLADA point me to some simple models that I can use to learn and test my importer as I write it? I will export a few with just geometry, but I need some with textures or materials, with skeletal and keyframe animation, etc. Any suggestions?

那么,所有这些......你们中的一些在 COLLADA 中有经验的人能否向我指出一些简单的模型,我可以在编写它时使用这些模型来学习和测试我的导入器?我将仅导出一些几何图形,但我需要一些带有纹理或材质、骨骼和关键帧动画等的内容。有什么建议吗?

Alternatively, I know that Blender can export COLLADA 1.4 and it can import most formats. If you have a really good suggestion for a site that has simple 3D models in another format that I will just import and export as COLLADA, that would be fine too!

或者,我知道 Blender 可以导出 COLLADA 1.4 并且可以导入大多数格式。如果您对一个网站有一个非常好的建议,该网站具有另一种格式的简单 3D 模型,我将作为 COLLADA 导入和导出,那也很好!

Thanks!

谢谢!

采纳答案by stevedbrown

I know two decent places at least:

我至少知道两个不错的地方:

The google site has lots of collada files, thingiverse has more in the way of stl (sterio lithography) files.

谷歌网站有很多 collada 文件,thingiverse 有更多的 stl(立体光刻)文件。

回答by rbaleksandar

The problem here is the fact that as far as I know there is no tool (at least available to the public) that supports the full Collada specification (especially 1.5). The part that is in most cases well tested and developed is the geometry-library element, materials etc., which in 1.5 are usually taken from some 1.4 implementation (that's why tools that usually state they support 1.5 actually don't (physics, kinematics etc. are in most cases missing or in bad condition). Still you can easily create decent (as in geometry part is OK but the rest - maybe is, maybe not) enough Collada files using various export-features of primarily 3d modeling software (Blender, Maya, 3ds Max, CATIA etc.). OpenRAVE (used for robotics path planning) actually has one of the best export/import capabilities, when it comes to COLLADA and even supports (partially) 1.5 features such as kinematics.

这里的问题是,据我所知,没有任何工具(至少对公众可用)支持完整的 Collada 规范(尤其是 1.5)。在大多数情况下,经过良好测试和开发的部分是几何库元素、材料等,这些在 1.5 中通常取自 1.4 的一些实现(这就是为什么通常声称支持 1.5 的工具实际上不支持(物理、运动学)等在大多数情况下丢失或状况不佳。仍然可以使用主要 3d 建模软件的各种导出功能轻松创建足够的 Collada 文件(如几何部分是可以的,但其余的 - 也许是,也许不是)足够的 Collada 文件( Blender、Maya、3ds Max、CATIA 等。OpenRAVE(用于机器人路径规划)实际上具有最好的导出/导入功能之一,

If you decide to use Blender for example (free and open source so you can actually look how the import/export addon works), you can create something simple or complex and export it as COLLADA 1.4 (not 1.5!). OpenRAVE for instance uses a custom XML-format that is converted internally to Collada (in order to hide the complexity of this standard) and allows you to even embed other formats (mostly for the geometry-part) such as OBJ, which is much much easier to find a decend import/export tool for. Khronos Group actually provides OpenCollada (OpenRAVE and many others use it internally, which of course results in bugs in all of them, when something is badly implemented in OpenCollada :P). The Assimp-library offers also quite a lot but the major problem is the misinformation it gives on what it actually supports from the Collada standard. In fact it is really, really hard to find a reference on the implemented features, when it comes to Collada, and sadly recently I started using 1.5 (kinematics) just to discover that Assimp supports only 1.4 and is bound to it to such extent that it throws errors at you the moment it encounters a typically 1.5 element (even if it is empty!), which omho is a really bad implementation on part of the developers. In the list of supported formats the Assimp's site states only Colladaand no version is given.

例如,如果您决定使用 Blender(免费和开源,因此您可以实际查看导入/导出插件的工作原理),您可以创建一些简单或复杂的内容并将其导出为 COLLADA 1.4(而不是 1.5!)。例如,OpenRAVE 使用自定义的 XML 格式,该格式在内部转换为 Collada(为了隐藏该标准的复杂性),并且甚至允许您嵌入其他格式(主要用于几何部分),例如 OBJ,这是非常多的更容易找到降级的导入/导出工具。Khronos Group 实际上提供了 OpenCollada(OpenRAVE 和许多其他公司在内部使用它,当 OpenCollada 中的某些东西实施不当时,这当然会导致所有这些错误:P)。Assimp-library 也提供了很多,但主要的问题是它提供的关于它实际支持的 Collada 标准的错误信息。事实上,当涉及到 Collada 时,很难找到有关已实现功能的参考资料,可悲的是,最近我开始使用 1.5(运动学)只是为了发现 Assimp 仅支持 1.4 并且在某种程度上受其约束当它遇到一个典型的 1.5 元素(即使它是空的!)时,它会向你抛出错误,这对开发人员来说是一个非常糟糕的实现。在支持的格式列表中,Assimp 的站点仅说明 对于部分开发人员来说,哪个 omho 是一个非常糟糕的实现。在支持的格式列表中,Assimp 的站点仅说明 对于部分开发人员来说,哪个 omho 是一个非常糟糕的实现。在支持的格式列表中,Assimp 的站点仅说明Collada并没有给出版本。

I know this question is old and answered but I hope this info helps. I myself am writing a parser in C# for internal usage where I'm currently working and it's a real pain to discover how badly supported this already an ISO standard is. The complexity of Collada is huge but that's why it is considered a pipeline-format and not something you are supposed to use in a final product that relays on good performance (both speed and storage).

我知道这个问题很老并且得到了回答,但我希望这些信息有所帮助。我自己正在用 C# 编写一个解析器,用于我目前正在工作的内部使用,发现这已经是一个 ISO 标准的支持有多糟糕真的很痛苦。Collada 的复杂性是巨大的,但这就是为什么它被认为是一种管道格式,而不是你应该在最终产品中使用的东西,它依赖于良好的性能(速度和存储)。

回答by joshbodily

Download Assimp the "Open Asset Import Library" from http://assimp.sourceforge.net/main_downloads.html. It has a whole bunch of Collada files (in test/models/Collada) that it uses for its test suites.

http://assimp.sourceforge.net/main_downloads.html下载 Assimp “Open Asset Import Library” 。它有一大堆 Collada 文件(在 test/models/Collada 中),用于其测试套件。

回答by demeigh27

Blendswap.com is a really great site with tons of models for Blender. Once you sign up for an account, you can download them for free. You can even use the majority of the models on the site commercially. Before you download it lets you know if you have to give the author credit, although some of the models can be used without giving credit, although it is recommended still. Keep in mind that there is a 200 MB limit per month for downloading. There are plenty of models that are 1MB, so check the size of the file before downloading. Then you can use the Collada exporter in Blender. Make sure to check the settings on the Collada exporter.

Blendswap.com 是一个非常棒的网站,里面有大量的 Blender 模型。注册帐户后,您可以免费下载它们。您甚至可以将网站上的大多数模型用于商业用途。在您下载之前,它会让您知道是否必须给予作者信用,尽管某些模型可以不给予信用而使用,尽管仍然建议这样做。请记住,每月有 200 MB 的下载限制。有很多模型都是 1MB,所以在下载之前检查文件的大小。然后你可以在 Blender 中使用 Collada 导出器。确保检查 Collada 导出器上的设置。

回答by Wilt

The WebGL framework three.jshas some examples here on their GitHUB page

WebGL 框架three.js在其Github 页面上有一些示例

The monster file can be seen in action here.

可以在此处查看运行中的怪物文件。