【问题标题】:threejs setClearColor setting the opacity to 0 although the background is not therethreejs setClearColor 将不透明度设置为 0 尽管背景不存在
【发布时间】:2018-02-20 16:42:18
【问题描述】:

我想设置背景颜色为空白,使用renderer.setClearColor (0xff0000, 0)[setClearColor]:Changing three.js background to transparent or other color,设置不透明度为0,虽然背景不存在,但是页面上,几乎没有模型

我已经添加了一些照片说明,但是信誉不够,请查看链接:https://github.com/shunzizhan/threejsDemo/wiki/three-scene

【问题讨论】:

  • 你的问题毫无意义。请以更好的方式解释您的问题是什么以及您想要完成什么。
  • @shunzizhan 你能在 cmets 这里提供一个实时链接吗?
  • 这个问题已经解决了,3Q @WestLangley

标签: background three.js


【解决方案1】:
this.renderer = new WebGLRenderer({
  antialias: true,
  alpha: true
})

设置属性alphatrue 然后

this.renderer.setClearColor(0xffffff, 0)

有效

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-02-22
    • 2013-11-08
    • 2023-03-06
    • 1970-01-01
    • 2014-01-24
    • 1970-01-01
    • 2016-10-23
    相关资源
    最近更新 更多