You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
<!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.AmbientLight( 0x404040 ); // 柔和的白光
|
|
|
|
|
scene.add( light );
|
|
|
|
|
</code>
|
|
|
|
|
|
|
|
|
|
<h2>构造函数</h2>
|
|
|
|
|
|
|
|
|
|
<h3>[name]( [param:Color color], [param:Float intensity] )</h3>
|
|
|
|
|
<p>
|
|
|
|
|
[page:Color color] -(可选)一个表示颜色的 Color 的实例、字符串或数字,默认为一个白色(0xffffff)的 [page:Color Color] 对象。<br />
|
|
|
|
|
[page:Float intensity] -(可选)光照的强度。默认值为 1。<br /><br />
|
|
|
|
|
|
|
|
|
|
创建一个环境光对象。
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<h2>属性</h2>
|
|
|
|
|
<p>
|
|
|
|
|
公共属性请查看基类 [page:Light Light]。
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<h3>[property:Boolean isAmbientLight]</h3>
|
|
|
|
|
<p>
|
|
|
|
|
只读,用于检查对象的类型是否为 [name]。
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h2>方法</h2>
|
|
|
|
|
<p>
|
|
|
|
|
公共方法请查看基类[page:Light Light]。
|
|
|
|
|
</p>
|
|
|
|
|
<h2>源码</h2>
|
|
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
|
|
|
|
|
</p>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|