- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Changing three.js background to transparent or another color in HTML
If you want a transparent background in three.js, you need a pass in the alpha parameter to the WebGLRenderer constructors in the below-given code −
var renderer = new THREE.WebGLRenderer( {alpha: true } ); // You can leave the clear color at the defaultvalue. renderer.setClearColor( 0x000000, 0 ); //default
However, to set the background color,
renderer.setClearColor(0xb0f442 );
Advertisements