2016-04-23 171 views
1

我有一個問題,在攪拌機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

在此先感謝!

回答

1

three.js導出器有很多選項,請檢查每個材質/ UV選項是否打開。

用下面的選項中啓用

three.js exporter settings

我得到以下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] 
} 
+0

感謝。我終於找到了所有這些選項。我之前在Blender中找到了多個其他的THREE選項卡,主要是在屬性編輯器(您選擇材質,紋理,UV,世界等等)中找到,但在導出期間沒有找到大標籤。 這實際上是我在學習Blender時遇到的最大問題:我能夠提出正確的問題,並且在教程或指南中看到正確的菜單/選項,但在應用程序中查找它是完全不同的故事。是否有某種選擇尋求者或某物? 無論如何,非常感謝,你已經解決了我有幾天的問題! :d – Scharnvirk