Three.js半球光光照HemisphereLight

本文介绍了Three.js中的HemisphereLight类,用于创建位于场景上方的半球光,常用于室外场景,但不支持阴影。详细说明了构造函数参数,包括天空颜色、地面颜色和光的强度,并提供了示例代码,展示如何设置不同颜色来影响场景中物体的照明效果。
摘要由CSDN通过智能技术生成

HemisphereLight

A light source positioned directly above the scene.

HemisphereLight类用于在场景中创建半球光,主要用在室外,但是没有阴影。

构造函数

HemisphereLight( skyColor, groundColor, intensity )

各参数解释如下:

skyColor — Numeric value of the RGB sky color.(天空的颜色)
groundColor — Numeric value of the RGB ground color.(地面的颜色)
intensity — Numeric value of the light’s strength/intensity.(光的强度)

例子代码

var renderer, scene, camera, cube, plane;
var stat = null;
//绑定canvas和渲染器
function initRender() {
   
    renderer = new THREE.WebGLRenderer();
    renderer.setSize( window.innerWidth, window.innerHeight );
    document.body.appendChild( renderer.domElement );
    //清除画面颜色
    renderer.setClearColor(0x000000);
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值