Changing three.js background to transparent or other color

后端 未结 6 1230
误落风尘
误落风尘 2020-11-28 02:55

I\'ve been trying to change what seems to be the default background color of my canvas from black to transparent / any other color - but no luck.

My HTML:

         


        
6条回答
  •  天涯浪人
    2020-11-28 03:39

    I found that when I created a scene via the three.js editor, I not only had to use the correct answer's code (above), to set up the renderer with an alpha value and the clear color, I had to go into the app.json file and find the "Scene" Object's "background" attribute and set it to: "background: null".

    The export from Three.js editor had it originally set to "background": 0

提交回复
热议问题