Libgdx 如何将blender 2.8制作的FBX转换为“g3db/g3dj”文件?

Libgdx 如何将blender 2.8制作的FBX转换为“g3db/g3dj”文件?,libgdx,Libgdx,我尝试用libGDX转换一个简单的立方体,但立方体没有显示在我的游戏应用程序中 FBX文件是使用blender 2.8创建的 另一方面,如果我使用blender 2.76制作一个FBX文件,然后将其转换为g3dj文件,它将成功显示 工作与不工作之间的唯一区别是属性TEXCOORD0 这里有2个g3dj文件,一个是用blender 2.76制作的,另一个是用blender 2.8制作的 这是一个有效的方法,使用blender 2.76创建FBX,然后转换为g3dj { "version":

我尝试用libGDX转换一个简单的立方体,但立方体没有显示在我的游戏应用程序中

FBX文件是使用blender 2.8创建的

另一方面,如果我使用blender 2.76制作一个FBX文件,然后将其转换为g3dj文件,它将成功显示

工作与不工作之间的唯一区别是属性
TEXCOORD0

这里有2个g3dj文件,一个是用blender 2.76制作的,另一个是用blender 2.8制作的

这是一个有效的方法,使用blender 2.76创建FBX,然后转换为
g3dj

{
    "version": [  0,   1], 
    "id": "", 
    "meshes": [
        {
            "attributes": ["POSITION", "NORMAL"], 
            "vertices": [
                -1.000000,  1.000000,  1.000000, -1.000000,  0.000000,  0.000000, 
                -1.000000,  1.000000, -1.000000, -1.000000,  0.000000,  0.000000, 
                -1.000000, -1.000000,  1.000000, -1.000000,  0.000000,  0.000000, 
                -1.000000, -1.000000, -1.000000, -1.000000,  0.000000,  0.000000, 
                 1.000000,  1.000000,  1.000000,  0.000000,  1.000000,  0.000000, 
                 1.000000,  1.000000, -1.000000,  0.000000,  1.000000,  0.000000, 
                -1.000000,  1.000000,  1.000000,  0.000000,  1.000000,  0.000000, 
                -1.000000,  1.000000, -1.000000,  0.000000,  1.000000,  0.000000, 
                 1.000000, -1.000000,  1.000000,  1.000000,  0.000000,  0.000000, 
                 1.000000, -1.000000, -1.000000,  1.000000,  0.000000,  0.000000, 
                 1.000000,  1.000000,  1.000000,  1.000000,  0.000000,  0.000000, 
                 1.000000,  1.000000, -1.000000,  1.000000,  0.000000,  0.000000, 
                -1.000000, -1.000000,  1.000000,  0.000000, -1.000000,  0.000000, 
                -1.000000, -1.000000, -1.000000,  0.000000, -1.000000,  0.000000, 
                 1.000000, -1.000000,  1.000000,  0.000000, -1.000000,  0.000000, 
                 1.000000, -1.000000, -1.000000,  0.000000, -1.000000,  0.000000, 
                 1.000000, -1.000000, -1.000000,  0.000000,  0.000000, -1.000000, 
                -1.000000, -1.000000, -1.000000,  0.000000,  0.000000, -1.000000, 
                 1.000000,  1.000000, -1.000000,  0.000000,  0.000000, -1.000000, 
                -1.000000,  1.000000, -1.000000,  0.000000,  0.000000, -1.000000, 
                -1.000000,  1.000000,  1.000000,  0.000000,  0.000000,  1.000000, 
                 1.000000, -1.000000,  1.000000,  0.000000,  0.000000,  1.000000, 
                 1.000000,  1.000000,  1.000000,  0.000000,  0.000000,  1.000000, 
                -1.000000, -1.000000,  1.000000,  0.000000,  0.000000,  1.000000
            ], 
            "parts": [
                {
                    "id": "Cube.002_part1", 
                    "type": "TRIANGLES", 
                    "indices": [
                          0,   1,   2,   2,   1,   3,   4,   5,   6,   6,   5,   7, 
                          8,   9,  10,  10,   9,  11,  12,  13,  14,  14,  13,  15, 
                         16,  17,  18,  17,  19,  18,  20,  21,  22,  21,  20,  23
                    ]
                }
            ]
        }
    ], 
    "materials": [
        {
            "id": "Material.005", 
            "ambient": [ 0.000000,  0.000000,  0.000000], 
            "diffuse": [ 0.800000,  0.800000,  0.800000], 
            "emissive": [ 0.800000,  0.800000,  0.800000], 
            "opacity":  1.000000, 
            "specular": [ 1.000000,  1.000000,  1.000000], 
            "shininess":  9.607843
        }
    ], 
    "nodes": [
        {
            "id": "Cube", 
            "rotation": [-0.707107, -0.000000,  0.000000,  0.707107], 
            "scale": [ 1.000000,  1.000000,  0.158538], 
            "parts": [
                {
                    "meshpartid": "Cube.002_part1", 
                    "materialid": "Material.005"
                }
            ]
        }
    ], 
    "animations": []
}
{
    "version": [  0,   1], 
    "id": "", 
    "meshes": [
        {
            "attributes": ["POSITION", "NORMAL", "TEXCOORD0"], 
            "vertices": [
                -1.000000,  1.000000,  1.000000, -1.000000,  0.000000,  0.000000,  0.625000,  0.750000, 
                -1.000000, -1.000000, -1.000000, -1.000000,  0.000000,  0.000000,  0.375000,  1.000000, 
                -1.000000, -1.000000,  1.000000, -1.000000,  0.000000,  0.000000,  0.625000,  1.000000, 
                -1.000000,  1.000000, -1.000000, -1.000000,  0.000000,  0.000000,  0.375000,  0.750000, 
                 1.000000,  1.000000,  1.000000,  0.000000,  1.000000,  0.000000,  0.625000,  0.500000, 
                -1.000000,  1.000000, -1.000000,  0.000000,  1.000000,  0.000000,  0.375000,  0.750000, 
                -1.000000,  1.000000,  1.000000,  0.000000,  1.000000,  0.000000,  0.625000,  0.750000, 
                 1.000000,  1.000000, -1.000000,  0.000000,  1.000000,  0.000000,  0.375000,  0.500000, 
                 1.000000, -1.000000,  1.000000,  1.000000,  0.000000,  0.000000,  0.625000,  0.250000, 
                 1.000000,  1.000000, -1.000000,  1.000000,  0.000000,  0.000000,  0.375000,  0.500000, 
                 1.000000,  1.000000,  1.000000,  1.000000,  0.000000,  0.000000,  0.625000,  0.500000, 
                 1.000000, -1.000000, -1.000000,  1.000000,  0.000000,  0.000000,  0.375000,  0.250000, 
                -1.000000, -1.000000,  1.000000,  0.000000, -1.000000,  0.000000,  0.625000,  0.000000, 
                 1.000000, -1.000000, -1.000000,  0.000000, -1.000000,  0.000000,  0.375000,  0.250000, 
                 1.000000, -1.000000,  1.000000,  0.000000, -1.000000,  0.000000,  0.625000,  0.250000, 
                -1.000000, -1.000000, -1.000000,  0.000000, -1.000000,  0.000000,  0.375000,  0.000000, 
                 1.000000, -1.000000, -1.000000,  0.000000,  0.000000, -1.000000,  0.375000,  0.250000, 
                -1.000000, -1.000000, -1.000000,  0.000000,  0.000000, -1.000000,  0.125000,  0.250000, 
                -1.000000,  1.000000, -1.000000,  0.000000,  0.000000, -1.000000,  0.125000,  0.500000, 
                 1.000000,  1.000000, -1.000000,  0.000000,  0.000000, -1.000000,  0.375000,  0.500000, 
                -1.000000,  1.000000,  1.000000,  0.000000,  0.000000,  1.000000,  0.875000,  0.500000, 
                -1.000000, -1.000000,  1.000000,  0.000000,  0.000000,  1.000000,  0.875000,  0.250000, 
                 1.000000,  1.000000,  1.000000,  0.000000,  0.000000,  1.000000,  0.625000,  0.500000, 
                 1.000000, -1.000000,  1.000000,  0.000000,  0.000000,  1.000000,  0.625000,  0.250000
            ], 
            "parts": [
                {
                    "id": "Cube.001_part1", 
                    "type": "TRIANGLES", 
                    "indices": [
                          0,   1,   2,   1,   0,   3,   4,   5,   6,   5,   4,   7, 
                          8,   9,  10,   9,   8,  11,  12,  13,  14,  13,  12,  15, 
                         16,  17,  18,  16,  18,  19,  20,  21,  22,  22,  21,  23
                    ]
                }
            ]
        }
    ], 
    "materials": [
        {
            "id": "Material.002", 
            "ambient": [ 0.050876,  0.050876,  0.050876], 
            "diffuse": [ 0.800000,  0.800000,  0.800000], 
            "emissive": [ 0.800000,  0.800000,  0.800000], 
            "opacity":  0.000000, 
            "specular": [ 0.800000,  0.800000,  0.800000], 
            "shininess":  25.000000
        }
    ], 
    "nodes": [
        {
            "id": "Cube", 
            "rotation": [-0.707107, -0.000000,  0.000000,  0.707107], 
            "scale": [ 1.000000,  1.000000,  0.081716], 
            "parts": [
                {
                    "meshpartid": "Cube.001_part1", 
                    "materialid": "Material.002", 
                    "uvMapping": [[]]
                }
            ]
        }
    ], 
    "animations": []
}
这是一个不起作用的,FBX使用blender 2.8创建,然后转换为
g3dj

{
    "version": [  0,   1], 
    "id": "", 
    "meshes": [
        {
            "attributes": ["POSITION", "NORMAL"], 
            "vertices": [
                -1.000000,  1.000000,  1.000000, -1.000000,  0.000000,  0.000000, 
                -1.000000,  1.000000, -1.000000, -1.000000,  0.000000,  0.000000, 
                -1.000000, -1.000000,  1.000000, -1.000000,  0.000000,  0.000000, 
                -1.000000, -1.000000, -1.000000, -1.000000,  0.000000,  0.000000, 
                 1.000000,  1.000000,  1.000000,  0.000000,  1.000000,  0.000000, 
                 1.000000,  1.000000, -1.000000,  0.000000,  1.000000,  0.000000, 
                -1.000000,  1.000000,  1.000000,  0.000000,  1.000000,  0.000000, 
                -1.000000,  1.000000, -1.000000,  0.000000,  1.000000,  0.000000, 
                 1.000000, -1.000000,  1.000000,  1.000000,  0.000000,  0.000000, 
                 1.000000, -1.000000, -1.000000,  1.000000,  0.000000,  0.000000, 
                 1.000000,  1.000000,  1.000000,  1.000000,  0.000000,  0.000000, 
                 1.000000,  1.000000, -1.000000,  1.000000,  0.000000,  0.000000, 
                -1.000000, -1.000000,  1.000000,  0.000000, -1.000000,  0.000000, 
                -1.000000, -1.000000, -1.000000,  0.000000, -1.000000,  0.000000, 
                 1.000000, -1.000000,  1.000000,  0.000000, -1.000000,  0.000000, 
                 1.000000, -1.000000, -1.000000,  0.000000, -1.000000,  0.000000, 
                 1.000000, -1.000000, -1.000000,  0.000000,  0.000000, -1.000000, 
                -1.000000, -1.000000, -1.000000,  0.000000,  0.000000, -1.000000, 
                 1.000000,  1.000000, -1.000000,  0.000000,  0.000000, -1.000000, 
                -1.000000,  1.000000, -1.000000,  0.000000,  0.000000, -1.000000, 
                -1.000000,  1.000000,  1.000000,  0.000000,  0.000000,  1.000000, 
                 1.000000, -1.000000,  1.000000,  0.000000,  0.000000,  1.000000, 
                 1.000000,  1.000000,  1.000000,  0.000000,  0.000000,  1.000000, 
                -1.000000, -1.000000,  1.000000,  0.000000,  0.000000,  1.000000
            ], 
            "parts": [
                {
                    "id": "Cube.002_part1", 
                    "type": "TRIANGLES", 
                    "indices": [
                          0,   1,   2,   2,   1,   3,   4,   5,   6,   6,   5,   7, 
                          8,   9,  10,  10,   9,  11,  12,  13,  14,  14,  13,  15, 
                         16,  17,  18,  17,  19,  18,  20,  21,  22,  21,  20,  23
                    ]
                }
            ]
        }
    ], 
    "materials": [
        {
            "id": "Material.005", 
            "ambient": [ 0.000000,  0.000000,  0.000000], 
            "diffuse": [ 0.800000,  0.800000,  0.800000], 
            "emissive": [ 0.800000,  0.800000,  0.800000], 
            "opacity":  1.000000, 
            "specular": [ 1.000000,  1.000000,  1.000000], 
            "shininess":  9.607843
        }
    ], 
    "nodes": [
        {
            "id": "Cube", 
            "rotation": [-0.707107, -0.000000,  0.000000,  0.707107], 
            "scale": [ 1.000000,  1.000000,  0.158538], 
            "parts": [
                {
                    "meshpartid": "Cube.002_part1", 
                    "materialid": "Material.005"
                }
            ]
        }
    ], 
    "animations": []
}
{
    "version": [  0,   1], 
    "id": "", 
    "meshes": [
        {
            "attributes": ["POSITION", "NORMAL", "TEXCOORD0"], 
            "vertices": [
                -1.000000,  1.000000,  1.000000, -1.000000,  0.000000,  0.000000,  0.625000,  0.750000, 
                -1.000000, -1.000000, -1.000000, -1.000000,  0.000000,  0.000000,  0.375000,  1.000000, 
                -1.000000, -1.000000,  1.000000, -1.000000,  0.000000,  0.000000,  0.625000,  1.000000, 
                -1.000000,  1.000000, -1.000000, -1.000000,  0.000000,  0.000000,  0.375000,  0.750000, 
                 1.000000,  1.000000,  1.000000,  0.000000,  1.000000,  0.000000,  0.625000,  0.500000, 
                -1.000000,  1.000000, -1.000000,  0.000000,  1.000000,  0.000000,  0.375000,  0.750000, 
                -1.000000,  1.000000,  1.000000,  0.000000,  1.000000,  0.000000,  0.625000,  0.750000, 
                 1.000000,  1.000000, -1.000000,  0.000000,  1.000000,  0.000000,  0.375000,  0.500000, 
                 1.000000, -1.000000,  1.000000,  1.000000,  0.000000,  0.000000,  0.625000,  0.250000, 
                 1.000000,  1.000000, -1.000000,  1.000000,  0.000000,  0.000000,  0.375000,  0.500000, 
                 1.000000,  1.000000,  1.000000,  1.000000,  0.000000,  0.000000,  0.625000,  0.500000, 
                 1.000000, -1.000000, -1.000000,  1.000000,  0.000000,  0.000000,  0.375000,  0.250000, 
                -1.000000, -1.000000,  1.000000,  0.000000, -1.000000,  0.000000,  0.625000,  0.000000, 
                 1.000000, -1.000000, -1.000000,  0.000000, -1.000000,  0.000000,  0.375000,  0.250000, 
                 1.000000, -1.000000,  1.000000,  0.000000, -1.000000,  0.000000,  0.625000,  0.250000, 
                -1.000000, -1.000000, -1.000000,  0.000000, -1.000000,  0.000000,  0.375000,  0.000000, 
                 1.000000, -1.000000, -1.000000,  0.000000,  0.000000, -1.000000,  0.375000,  0.250000, 
                -1.000000, -1.000000, -1.000000,  0.000000,  0.000000, -1.000000,  0.125000,  0.250000, 
                -1.000000,  1.000000, -1.000000,  0.000000,  0.000000, -1.000000,  0.125000,  0.500000, 
                 1.000000,  1.000000, -1.000000,  0.000000,  0.000000, -1.000000,  0.375000,  0.500000, 
                -1.000000,  1.000000,  1.000000,  0.000000,  0.000000,  1.000000,  0.875000,  0.500000, 
                -1.000000, -1.000000,  1.000000,  0.000000,  0.000000,  1.000000,  0.875000,  0.250000, 
                 1.000000,  1.000000,  1.000000,  0.000000,  0.000000,  1.000000,  0.625000,  0.500000, 
                 1.000000, -1.000000,  1.000000,  0.000000,  0.000000,  1.000000,  0.625000,  0.250000
            ], 
            "parts": [
                {
                    "id": "Cube.001_part1", 
                    "type": "TRIANGLES", 
                    "indices": [
                          0,   1,   2,   1,   0,   3,   4,   5,   6,   5,   4,   7, 
                          8,   9,  10,   9,   8,  11,  12,  13,  14,  13,  12,  15, 
                         16,  17,  18,  16,  18,  19,  20,  21,  22,  22,  21,  23
                    ]
                }
            ]
        }
    ], 
    "materials": [
        {
            "id": "Material.002", 
            "ambient": [ 0.050876,  0.050876,  0.050876], 
            "diffuse": [ 0.800000,  0.800000,  0.800000], 
            "emissive": [ 0.800000,  0.800000,  0.800000], 
            "opacity":  0.000000, 
            "specular": [ 0.800000,  0.800000,  0.800000], 
            "shininess":  25.000000
        }
    ], 
    "nodes": [
        {
            "id": "Cube", 
            "rotation": [-0.707107, -0.000000,  0.000000,  0.707107], 
            "scale": [ 1.000000,  1.000000,  0.081716], 
            "parts": [
                {
                    "meshpartid": "Cube.001_part1", 
                    "materialid": "Material.002", 
                    "uvMapping": [[]]
                }
            ]
        }
    ], 
    "animations": []
}
那么有没有办法在blender 2.8中省略这个属性呢?或者更好地让libgdx考虑这个属性


我在blender 2.8中使用漫反射BSDF材质

将不透明度设置为1而不是0。@Xoppa是的,我在发布后的几分钟内发现了,但为什么转换器将不透明度设置为
0
?我需要一个不需要编辑
g3dj
文件的解决方案,因为我使用它只是为了调试,我计划使用
g3db
尝试在blender中将不透明度设置为1,它可能被称为alpha,可能是材质透明度设置的一部分。@Xoppa我已经尝试过了,即使alpha已经设置为1,不透明度将设置为0,如果我在blender中将alpha设置为1.1,它将在
g3dj
中将不透明度设置为
-0.110000
如果我在blender
g3dj
中将alpha设置为
g3dj
文件不透明度将
0.799920
这是如果我使用纹理,如果我使用漫反射BSDF材质,它将不会在blender中显示alpha选项