简体   繁体   English

在JavaFX中导入动画3D模型

[英]Importing animated 3D models in JavaFX

I am currently working on creating a 3D scene using JavaFX. 我目前正在使用JavaFX创建3D场景。 In the scene I would like to show some more complex 3D models. 在场景中,我想展示一些更复杂的3D模型。 I, therefore, used the InteractiveMesh importers for importing some OBJ/STL models, which worked fine. 因此,我使用InteractiveMesh导入器导入一些工作正常的OBJ / STL模型。 I would also like to include an animated model (walk cycle). 我还想包括一个动画模型(步行周期)。 I found the JavaFX sample application 3DViewer which includes a Maya-Importer. 我找到了包含Maya-Importer的JavaFX示例应用程序3DViewer。 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. 由于我不熟悉Maya和3D建模,我试图找到一些免费的模型,这些模型是动画的或至少是在线操纵的。 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. 不幸的是,我找不到一个单独的模型,既不适合创建动画步行周期(操纵)也不适合动画,我可以在3DViewer中成功打开。 The import usually fails due to Nullpointer- or IndexOutOfBoundsExceptions while loading the Maya model. 在加载Maya模型时,导入通常会因Nullpointer-或IndexOutOfBoundsExceptions而失败。

I am now wondering if somebody has already managed to open an animated Maya model in 3DViewer? 我现在想知道是否有人已经设法在3DViewer中打开一个动画Maya模型? 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? 此外,还有其他方法可以将动画3D模型(不一定是Maya模型)导入JavaFX吗?

You can have a look at this project: https://github.com/jperedadnr/RiggedHand 你可以看看这个项目: 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. 它并不完全符合您的要求(导入动画3D模型),但它设法为给定的3D模型设置动画,在本例中使用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. 如果检查HandImporter类,它将基于SkinningMesh的创建,因为它是在您已经提到的3DViewer项目下定义的。 This will contain the 3D mesh for the hand, the weights and the tree of joints. 这将包含手的3D网格,权重和关节树。

RiggedHand

This is the same technic as the one used for the Duke chess animation : 这与杜克国际象棋动画中使用的技术相同:

RiggedDuke

Additionally, are there other ways of importing animated 3D models (not necessarily Maya models) into JavaFX? 此外,还有其他方法可以将动画3D模型(不一定是Maya模型)导入JavaFX吗?

and the bounty's 和赏金的

I would like to see a solution for importing any readied animated 3D model into JavaFX. 我想看到一个解决方案,用于将任何准备好的动画3D模型导入JavaFX。

It appears that the 3D viewer 's support for .ma files is the only readily available way to import 3D animated models. 看来3D查看器.ma文件的支持是导入3D动画模型的唯一可行方式。

InteractiveMesh's importers do not import animation, as well as Tesis Dynaware's FBX importer . InteractiveMesh的导入器不会导入动画,也不会导入Tesis Dynaware的FBX导入器

Edit: 编辑:

OpenJDK lists that it will not provide importers: OpenJDK列出它不会提供进口商:

Loader support 装载机支持

  • Many 3D file formats exist, such as: 存在许多3D文件格式,例如:
    • Obj, Maya, 3D Studio Max, Collada, KRML Obj,Maya,3D Studio Max,Collada,KRML
  • We will not provide a loader as part of the JavaFX runtime 我们不会将加载器作为JavaFX运行时的一部分提供
  • We will make sample code available for one or two popular formats 我们将为一种或两种流行格式提供示例代码

See the comments there as well as this enhancement request . 请参阅此处的评论以及此增强请求

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM