在 JavaFX 中导入动画 3D 模型 [英] Importing animated 3D models in JavaFX

查看:70
本文介绍了在 JavaFX 中导入动画 3D 模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用 JavaFX 创建 3D 场景.在场景中,我想展示一些更复杂的 3D 模型.因此,我使用 InteractiveMesh 导入器来导入一些 OBJ/STL 模型,效果很好.我还想包括一个动画模型(步行周期).我找到了包含 Maya-Importer 的 JavaFX 示例应用程序 3DViewer.由于我对 Maya 和 3D 建模一般不太熟悉,我试图在网上找到一些免费模型,这些模型是动画的或至少是操纵的.不幸的是,我找不到一个模型,既不适合创建动画步行周期(操纵),也没有动画,我可以在 3DViewer 中成功打开.由于加载 Maya 模型时出现 Nullpointer 或 IndexOutOfBoundsExceptions,导入通常会失败.

我现在想知道是否有人已经设法在 3DViewer 中打开了动画 Maya 模型?我非常感谢可以成功导入模型的参考.

此外,是否有其他方法可以将动画 3D 模型(不一定是 Maya 模型)导入 JavaFX?

解决方案

你可以看看这个项目:

这与杜克国际象棋使用的技术相同

I am currently working on creating a 3D scene using JavaFX. In the scene I would like to show some more complex 3D models. I, therefore, used the InteractiveMesh importers for importing some OBJ/STL models, which worked fine. I would also like to include an animated model (walk cycle). I found the JavaFX sample application 3DViewer which includes a Maya-Importer. As I am not that familiar with Maya and 3D modelling in general I tried to find some free models, which are animated or at least rigged, online. Unfortunately, I could not find a single model, neither suitable for creating an animated walk cycle (rigged) nor already animated, I could successfully open in 3DViewer. The import usually fails due to Nullpointer- or IndexOutOfBoundsExceptions while loading the Maya model.

I am now wondering if somebody has already managed to open an animated Maya model in 3DViewer? I highly appreciate references to models, which can successfully be imported.

Additionally, are there other ways of importing animated 3D models (not necessarily Maya models) into JavaFX?

解决方案

You can have a look at this project: https://github.com/jperedadnr/RiggedHand

It is not exactly doing what you want (import an animated 3D model), but it manages to animate a given 3D model, in this case using Leap Motion.

You can have a look at the result on this video.

If you check HandImporter class, it is based in the creation of a SkinningMesh, as it is defined under the 3DViewer project you already mentioned. This will contain the 3D mesh for the hand, the weights and the tree of joints.

This is the same technic as the one used for the Duke chess animation:

这篇关于在 JavaFX 中导入动画 3D 模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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