|
|
<!DOCTYPE html>
|
|
|
<html lang="zh">
|
|
|
<head>
|
|
|
<meta charset="utf-8" />
|
|
|
<base href="../../../" />
|
|
|
<script src="page.js"></script>
|
|
|
<link type="text/css" rel="stylesheet" href="page.css" />
|
|
|
</head>
|
|
|
<body>
|
|
|
[page:Object3D] → [page:Light] →
|
|
|
|
|
|
<h1>半球光([name])</h1>
|
|
|
|
|
|
<p class="desc">
|
|
|
光源直接放置于场景之上,光照颜色从天空光线颜色渐变到地面光线颜色。
|
|
|
<br /><br />
|
|
|
|
|
|
半球光不能投射阴影。
|
|
|
</p>
|
|
|
|
|
|
<h2>代码示例</h2>
|
|
|
|
|
|
<code>
|
|
|
const light = new THREE.HemisphereLight( 0xffffbb, 0x080820, 1 );
|
|
|
scene.add( light );
|
|
|
</code>
|
|
|
|
|
|
<h2>例子</h2>
|
|
|
|
|
|
<p>
|
|
|
[example:webgl_animation_skinning_blending animation / skinning / blending ]<br />
|
|
|
[example:webgl_lights_hemisphere lights / hemisphere ]<br />
|
|
|
[example:misc_controls_pointerlock controls / pointerlock ]<br />
|
|
|
[example:webgl_loader_collada_kinematics loader / collada / kinematics ]<br />
|
|
|
[example:webgl_loader_stl loader / stl ]
|
|
|
</p>
|
|
|
|
|
|
<h2>构造器(Constructor)</h2>
|
|
|
<h3>[name]( [param:Integer skyColor], [param:Integer groundColor], [param:Float intensity] )</h3>
|
|
|
<p>
|
|
|
[page:Color skyColor] -(可选)一个表示颜色的 Color 的实例、字符串或数字,默认为一个白色(0xffffff)的 [page:Color Color] 对象。<br />
|
|
|
[page:Color groundColor] -(可选)一个表示颜色的 Color 的实例、字符串或数字,默认为一个白色(0xffffff)的 [page:Color Color] 对象。<br />
|
|
|
[page:Float intensity] -(可选)光照强度。默认值为 1。<br /><br />
|
|
|
|
|
|
创建一个半球光。
|
|
|
</p>
|
|
|
|
|
|
<h2>属性(Properties)</h2>
|
|
|
<p>
|
|
|
公共属性请查看基类 [page:Light Light]。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Color color]</h3>
|
|
|
<p>
|
|
|
在构造时传递的天空发出光线的颜色。
|
|
|
默认值为白色(0xffffff)的 [page:Color] 对象。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Color groundColor]</h3>
|
|
|
<p>
|
|
|
在构造时传递的地面发出光线的颜色。
|
|
|
默认值为白色(0xffffff)的 [page:Color] 对象。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Boolean isHemisphereLight]</h3>
|
|
|
<p>
|
|
|
只读,用于检查对象的类型是否为 [name]。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Vector3 position]</h3>
|
|
|
<p>
|
|
|
假如这个值设置为 [page:Object3D.DEFAULT_UP] (0, 1, 0),光线将会从上往下照射。
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
<h2>方法(Methods)</h2>
|
|
|
|
|
|
<p>公共方法请查看基类 [page:Light Light]。</p>
|
|
|
|
|
|
<h3>[method:this copy]( [param:HemisphereLight source] )</h3>
|
|
|
<p>
|
|
|
从 [page:Light source] 复制 [page:.color color]、[page:.intensity intensity] 和
|
|
|
[page:.groundColor groundColor] 的值到当前半球光对象中。
|
|
|
</p>
|
|
|
|
|
|
<h2>源码</h2>
|
|
|
|
|
|
<p>
|
|
|
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
|
|
|
</p>
|
|
|
</body>
|
|
|
</html>
|