我想问一下,如何在JSON模型格式3.1中定义透明材料。我尝试过以下JSON,但没有成功:
{
"metadata": {
"formatVersion" : 3
},
"materials": [{
"DbgColor" : 15658734,
"DbgIndex" : 0,
"DbgName" : "dummy",
"illumination" : 2,
"opticalDensity" : 0.5,
"transparency" : 0.5,
"colorAmbient" : [ 0.9, 0.1, 0.1 ],
"colorDiffuse" : [ 0.1, 0.7, 0.1 ]
}],
"vertices": [0,0,0, 100,0,0, 100,100,0, 0,100,0 ],
"normals": [],
"colors": [1,0,0, 0,1,0 ],
"uvs": [],
"faces": [67, 0,1,2,3,0, 1]
}
我也尝试过使用不同的照度、光密度和透明度值,但也没有成功。
感谢Jan
您需要设置transparent: true
和transparency: 0.5
。后者映射到CCD_ 3。
"materials": [ {
"DbgColor" : 15658734,
"DbgIndex" : 0,
"DbgName" : "dummy",
"transparent" : true,
"transparency" : 0.5,
"colorAmbient" : [ 0.9, 0.1, 0.1 ],
"colorDiffuse" : [ 0.1, 0.7, 0.1 ]
}],
three.js r.60