How to change three.js background to transparent or other color with JavaScript?

Spread the love

Sometimes, we want to change three.js background to transparent or other color with JavaScript.

In this article, we’ll look at how to change three.js background to transparent or other color with JavaScript.

How to change three.js background to transparent or other color with JavaScript?

To change three.js background to transparent or other color with JavaScript, we set the background property.

For instance, we write

const scene = new THREE.Scene();
scene.background = new THREE.Color(0xff0000);

to set the scene‘s background to a transparent color.

Conclusion

To change three.js background to transparent or other color with JavaScript, we set the background property.

Leave a Reply

Your email address will not be published.