【发布时间】:2020-08-24 13:10:21
【问题描述】:
我在 android 应用程序中使用 sceneform 1.17.1 并下载 glb 以显示它。 我的问题是我有两个 3D 模型,其中一个,图像纹理适用。在另一种情况下,图像纹理不适用。
使用 khronos gltf 验证器,它们看起来很相似。这是一个可以正常工作的:
{
"uri": "AviatorApp_98.glb",
"mimeType": "model/gltf-binary",
"validatorVersion": "2.0.0-dev.3.2",
"validatedAt": "2020-08-24T12:53:37.209Z",
"issues": {
"numErrors": 0,
"numWarnings": 0,
"numInfos": 0,
"numHints": 0,
"messages": [],
"truncated": false
},
"info": {
"version": "2.0",
"generator": "Gestaltor 2020.2.1 Alpha 'Zuckerwatte' (CI-38fb8ee1*)",
"resources": [
{
"pointer": "/buffers/0",
"mimeType": "application/gltf-buffer",
"storage": "glb",
"byteLength": 1501852
},
{
"pointer": "/images/0",
"mimeType": "image/jpeg",
"storage": "buffer-view",
"image": {
"width": 1024,
"height": 1024,
"format": "rgb",
"bits": 8
}
},
{
"pointer": "/images/1",
"mimeType": "image/png",
"storage": "buffer-view",
"image": {
"width": 1024,
"height": 1024,
"format": "rgba",
"primaries": "srgb",
"transfer": "srgb",
"bits": 8
}
}
],
"animationCount": 0,
"materialCount": 3,
"hasMorphTargets": false,
"hasSkins": false,
"hasTextures": true,
"hasDefaultScene": true,
"drawCallCount": 3,
"totalVertexCount": 15848,
"totalTriangleCount": 28336,
"maxUVs": 1,
"maxInfluences": 0,
"maxAttributes": 4
}
}
这是不加载纹理的那个:
{
"uri": "ChromanceApp_98_2.glb",
"mimeType": "model/gltf-binary",
"validatorVersion": "2.0.0-dev.3.2",
"validatedAt": "2020-08-24T12:56:29.902Z",
"issues": {
"numErrors": 0,
"numWarnings": 0,
"numInfos": 0,
"numHints": 0,
"messages": [],
"truncated": false
},
"info": {
"version": "2.0",
"generator": "Gestaltor 2020.2.1 Alpha 'Zuckerwatte' (CI-38fb8ee1*)",
"resources": [
{
"pointer": "/buffers/0",
"mimeType": "application/gltf-buffer",
"storage": "glb",
"byteLength": 3235956
},
{
"pointer": "/images/0",
"mimeType": "image/jpeg",
"storage": "buffer-view",
"image": {
"width": 1024,
"height": 1024,
"format": "rgb",
"bits": 8
}
},
{
"pointer": "/images/1",
"mimeType": "image/png",
"storage": "buffer-view",
"image": {
"width": 1024,
"height": 1024,
"format": "rgba",
"primaries": "srgb",
"transfer": "srgb",
"bits": 8
}
}
],
"animationCount": 0,
"materialCount": 3,
"hasMorphTargets": false,
"hasSkins": false,
"hasTextures": true,
"hasDefaultScene": true,
"drawCallCount": 3,
"totalVertexCount": 51070,
"totalTriangleCount": 38324,
"maxUVs": 1,
"maxInfluences": 0,
"maxAttributes": 4
}
}
我在应用程序中没有收到任何错误。如何使用纹理显示我的 3D 模型?
【问题讨论】:
标签: android 3d arcore sceneform