在 HTML 中将 three.js 背景更改为透明或其他颜色
如果你想要 three.js 中具有透明背景,你需要在下列给定代码中,将 alpha 参数传递给 WebGLRenderer 构造函数中 −
var renderer = new THREE.WebGLRenderer( {alpha: true } );
// You can leave the clear color at the defaultvalue.
renderer.setClearColor( 0x000000, 0 ); //default
然而,要设置背景颜色,
renderer.setClearColor(0xb0f442 );
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
JavaScript
PHP