为什么我在 aframe 中加载模型时会丢失 .obj 纹理?
Why am I loosing .obj texture when loading the model in aframe?
我在 Maya 中创建了一个模型,然后将其导出为 .obj
文件。 Maya 创建了 .obj
和 .mtl
文件,但它没有引用 .mtl
文件中的纹理图像,所以我在文件末尾手动添加了它,如下所示:
map_Kd paht/to/texture_image/texture_image.png
当我将 .obj
模型导入搅拌机进行测试时,它看起来像这样:
How the .obj
looks when I open it in Blender
显然它看起来像那样,因为 Blender 在 Solid 模式 中打开它,所以当我更改为 Texture 模式 时,我实际上可以看到我的质地:
How the .obj
looks when I change to Texture mode
当我在 aframe 项目中加载 .obj
时,它看起来与在 Solid 模式 中一样(这是不是我想要的)。
(我不能 post 第三张图片 link 但相信我,在 aframe 里面它看起来和在 blender solid 模式下完全一样,它是完全黑色的)
我尝试了什么
我正在 aframe 中加载 .obj
模型,就像我加载其他正确加载的模型一样,就像这样:
<a-entity position = '0 0 -5' obj-model = "obj: url(path/to/file/model.obj); mtl: url(path/to/file/model.mtl)"></a-entity>
我什至确保我的 .mtl
文件正确引用我用作纹理的 .png
图像。
重现步骤
- 在 Maya 中创建 3d 模型
- 将模型导出为
.obj
- 手动将 texture_image 引用添加到
.mtl
生成的文件
- 将
.obj
文件导入 Blender 并更改为 纹理模式 以确保纹理加载正常
- 在 aframe 页面中加载
.obj
文件
观察结果
我使用的是 Windows 10 PC,这里我使用的是 Maya 2017 和 Blender 2.78。对于 aframe 项目,我使用的是 macOS Sierra。
我在 Maya 中创建了一个模型,然后将其导出为 .obj
文件。 Maya 创建了 .obj
和 .mtl
文件,但它没有引用 .mtl
文件中的纹理图像,所以我在文件末尾手动添加了它,如下所示:
map_Kd paht/to/texture_image/texture_image.png
当我将 .obj
模型导入搅拌机进行测试时,它看起来像这样:
How the .obj
looks when I open it in Blender
显然它看起来像那样,因为 Blender 在 Solid 模式 中打开它,所以当我更改为 Texture 模式 时,我实际上可以看到我的质地:
How the .obj
looks when I change to Texture mode
当我在 aframe 项目中加载 .obj
时,它看起来与在 Solid 模式 中一样(这是不是我想要的)。
(我不能 post 第三张图片 link 但相信我,在 aframe 里面它看起来和在 blender solid 模式下完全一样,它是完全黑色的)
我尝试了什么
我正在 aframe 中加载 .obj
模型,就像我加载其他正确加载的模型一样,就像这样:
<a-entity position = '0 0 -5' obj-model = "obj: url(path/to/file/model.obj); mtl: url(path/to/file/model.mtl)"></a-entity>
我什至确保我的 .mtl
文件正确引用我用作纹理的 .png
图像。
重现步骤
- 在 Maya 中创建 3d 模型
- 将模型导出为
.obj
- 手动将 texture_image 引用添加到
.mtl
生成的文件 - 将
.obj
文件导入 Blender 并更改为 纹理模式 以确保纹理加载正常 - 在 aframe 页面中加载
.obj
文件
观察结果
我使用的是 Windows 10 PC,这里我使用的是 Maya 2017 和 Blender 2.78。对于 aframe 项目,我使用的是 macOS Sierra。