繁体   English   中英

以JSON模型格式3.1定义透明材料

[英]Define transparent material in JSON Model format 3.1

我想问一下,如何以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: truetransparency: 0.5 后者映射为opacity

"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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM