搅拌机出口THREE.js
问题描述:
我有一个问题,在搅拌机THREE.js出口,即:材料和纹理根本不出口。搅拌机出口THREE.js
为了显示这个问题,我创建了一个具有一个材质和一个纹理的简单平面。
这是通过JSON导出生成整个文件:
{
"faces":[41,0,1,3,2,0,1,2,3,0,0,0,0],
"metadata":{
"faces":1,
"type":"Geometry",
"uvs":1,
"generator":"io_three",
"normals":1,
"version":3,
"vertices":4
},
"uvs":[[0.0001,0.0001,0.9999,0.0001,0.9999,0.9999,0.0001,0.9999]],
"normals":[1,0,0],
"name":"PlaneGeometry",
"vertices":[-0,3e-06,16,1e-06,-4e-06,-16,-1e-06,32,16,0,32,-16]
}
在对比,这是给OBJ/MTL波前格式出口(这证实存在确实是一种材料和质地组为模型)
# Blender v2.76 (sub 0) OBJ File: 'wall_pipes.blend'
# www.blender.org
mtllib wall_pipes.mtl
o Plane
v -0.000000 0.000003 16.000002
v 0.000001 -0.000002 -15.999997
v -0.000001 32.000000 15.999997
v 0.000000 31.999996 -16.000002
vt 0.000100 0.000100
vt 0.999900 0.000100
vt 0.999900 0.999900
vt 0.000100 0.999900
vn 1.000000 0.000000 0.000000
usemtl Material.001
s off
f 1/1/1 2/2/1 4/3/1 3/4/1
...及其相应的MTL文件...
# Blender MTL File: 'wall_pipes.blend'
# Material Count: 1
newmtl Material.001
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.021739 0.021739 0.021739
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
map_Kd E:\blender\models\library\textures\pk02_pipes01_C.png
map_Bump E:\\blender\\models\\library\\textures\\pk02_pipes01_C.png
我觉得荷兰国际集团有关使用这些生成的OBJ/MTL文件,但three.js所R73(我更喜欢在新的阴影格式),似乎有一些问题与他们:
[.CommandBufferContext]RENDER WARNING: Render count or primcount is 0.
无论如何,我想使用JSON格式因为这对我来说更自然,而这正是其他人在别处建议的。我很抱歉,如果这种缺乏物质的问题是真的,真的很愚蠢:)
这里是.blend文件,也许我做错了什么或有一个复选框取消选中某处...? https://github.com/Scharnvirk/wingmod/raw/blender_issue/models/wall_pipes.blend
在此先感谢!
答
three.js导出器有很多选项,请检查每个材质/ UV选项是否打开。
用下面的选项中启用
我得到以下JSON
{
"faces":[43,0,1,3,2,0,0,1,2,3,0,0,0,0],
"metadata":{
"version":3,
"type":"Geometry",
"uvs":1,
"materials":1,
"faces":1,
"normals":1,
"generator":"io_three",
"vertices":4
},
"normals":[1,0,0],
"name":"PlaneGeometry",
"uvs":[[0.0001,0.0001,0.9999,0.0001,0.9999,0.9999,0.0001,0.9999]],
"materials":[{
"mapBumpAnisotropy":1,
"mapDiffuseAnisotropy":1,
"wireframe":false,
"mapBumpWrap":["RepeatWrapping","RepeatWrapping"],
"mapSpecularAnisotropy":1,
"specularCoef":50,
"visible":true,
"mapSpecularRepeat":[1,1],
"mapBumpScale":[2.05634,2.05634],
"DbgColor":15658734,
"mapSpecular":"pk02_pipes01_C.png",
"mapDiffuse":"pk02_pipes01_C.png",
"depthWrite":true,
"mapBump":"pk02_pipes01_C.png",
"mapDiffuseWrap":["RepeatWrapping","RepeatWrapping"],
"shading":"phong",
"depthTest":true,
"DbgName":"Material.001",
"opacity":1,
"colorDiffuse":[0.8,0.8,0.8],
"transparent":false,
"mapSpecularWrap":["RepeatWrapping","RepeatWrapping"],
"DbgIndex":0,
"colorSpecular":[0.021739,0.021739,0.021739],
"mapBumpRepeat":[1,1],
"mapDiffuseRepeat":[1,1],
"colorEmissive":[0,0,0],
"blending":"NormalBlending"
}],
"vertices":[-0,3e-06,16,1e-06,-4e-06,-16,-1e-06,32,16,0,32,-16]
}
感谢。我终于找到了所有这些选项。我之前在Blender中找到了多个其他的THREE选项卡,主要是在属性编辑器(您选择材质,纹理,UV,世界等等)中找到,但在导出期间没有找到大标签。 这实际上是我在学习Blender时遇到的最大问题:我能够提出正确的问题,并且在教程或指南中看到正确的菜单/选项,但在应用程序中查找它是完全不同的故事。是否有某种选择寻求者或某物? 无论如何,非常感谢,你已经解决了我有几天的问题! :d – Scharnvirk