阅读.FBX动画?

时间:2013-07-11 19:26:45

标签: java fbx

'Ello,这里的新帖子。介绍时间?你好。

接下来,我想问一下如何从.fbx文件中读取动画。我正在使用Java和OpenGL,但这对于这个问题并不太重要。我查看过几个不同的来源,无法找到有关.FBX文件格式的任何信息。

我的模型加载器当前加载在名称,索引,顶点,法线,骨骼名称,骨骼权重和骨骼矩阵中。但是我很难理解如何从这里阅读动画。

我可以假设这是文件的动画部分。

;Takes and animation section
;----------------------------------------------------

Takes:  {
    Current: "ArmatureAction"
    Take: "ArmatureAction" {
        FileName: "ArmatureAction.tak"
        LocalTime: -1924423249,105843278750
        ReferenceTime: -1924423249,105843278750

        ;Models animation
        ;----------------------------------------------------
        Model: "Model::body" {
            Version: 1.1
            Channel: "Transform" {
                Channel: "T" {
                    Channel: "X" {
                        Default: 0.000000000000000
                        KeyVer: 4005
                        KeyCount: 1
                        Key: 
                            1924423250,0.000000000000000,L
                        Color: 1,0,0
                    }
                    Channel: "Y" {
                        Default: 0.000000000000000
                        KeyVer: 4005
                        KeyCount: 1
                        Key: 
                            1924423250,0.000000000000000,L
                        Color: 0,1,0
                    }
                    Channel: "Z" {
                        Default: 0.000000000000000
                        KeyVer: 4005
                        KeyCount: 1
                        Key: 
                            1924423250,0.000000000000000,L
                        Color: 0,0,1
                    }
                    LayerType: 1
                }
                Channel: "R" {
                    Channel: "X" {
                        Default: 90.000002504348856
                        KeyVer: 4005
                        KeyCount: 1
                        Key: 
                            1924423250,90.000002504348856,L
                        Color: 1,0,0
                    }
                    Channel: "Y" {
                        Default: -89.999995674159678
                        KeyVer: 4005
                        KeyCount: 1
                        Key: 
                            1924423250,-89.999995674159678,L
                        Color: 0,1,0
                    }
                    Channel: "Z" {
                        Default: 0.000000000000000
                        KeyVer: 4005
                        KeyCount: 1
                        Key: 
                            1924423250,0.000000000000000,L
                        Color: 0,0,1
                    }
                    LayerType: 2
                }
                Channel: "S" {
                    Channel: "X" {
                        Default: 1.000000000000000
                        KeyVer: 4005
                        KeyCount: 1
                        Key: 
                            1924423250,1.000000000000000,L
                        Color: 1,0,0
                    }
                    Channel: "Y" {
                        Default: 1.000000000000000
                        KeyVer: 4005
                        KeyCount: 1
                        Key: 
                            1924423250,1.000000000000000,L
                        Color: 0,1,0
                    }
                    Channel: "Z" {
                        Default: 1.000000000000000
                        KeyVer: 4005
                        KeyCount: 1
                        Key: 
                            1924423250,1.000000000000000,L
                        Color: 0,0,1
                    }
                    LayerType: 3
                }
            }
        }
        Model: "Model::head" {
            Version: 1.1
            Channel: "Transform" {
                Channel: "T" {
                    Channel: "X" {...............................

善良的灵魂请解释一下这是如何格式化的?帮助赞赏!

1 个答案:

答案 0 :(得分:3)

由于(IIRC)FBX规范不公开,您通常希望使用FBX SDK。

online documentation是开始学习的好地方。但是,SDK只公开C ++和Python API。

您还可以查看Blender(开源),它提供FBX exporter written without using the FBX SDK

维基百科还指出,OpenEndedGroup的产品Field包含一个FBX java库。您可以在Github找到他们的代码,您感兴趣的部分可能是jfbxlib的一部分。