Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
c3768568
T
three.js
项目概览
Ablesons
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c3768568
编写于
4月 10, 2013
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'WestLangley/dev-spotlight' into dev
上级
69bc8aa0
46a22446
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
11 addition
and
10 deletion
+11
-10
docs/api/lights/SpotLight.html
docs/api/lights/SpotLight.html
+2
-2
examples/webgl_loader_ctm.html
examples/webgl_loader_ctm.html
+1
-1
examples/webgl_materials_cubemap_dynamic.html
examples/webgl_materials_cubemap_dynamic.html
+1
-1
examples/webgl_shading_physical.html
examples/webgl_shading_physical.html
+1
-1
examples/webgl_shadowmap_performance.html
examples/webgl_shadowmap_performance.html
+1
-1
src/extras/helpers/SpotLightHelper.js
src/extras/helpers/SpotLightHelper.js
+4
-3
src/lights/SpotLight.js
src/lights/SpotLight.js
+1
-1
未找到文件。
docs/api/lights/SpotLight.html
浏览文件 @
c3768568
...
...
@@ -67,8 +67,8 @@ scene.add( spotLight );</code>
<h3>
.[page:Float angle]
</h3>
<div>
Maximum extent of the spotlight, in radians, from its direction.
<br
/>
Default — *Math.PI/
2
*.
Maximum extent of the spotlight, in radians, from its direction.
Should be no more than *Math.PI/2*.
<br
/>
Default — *Math.PI/
3
*.
</div>
<h3>
.[page:Float exponent]
</h3>
...
...
examples/webgl_loader_ctm.html
浏览文件 @
c3768568
...
...
@@ -99,7 +99,7 @@
var
ambient
=
new
THREE
.
AmbientLight
(
0x080808
);
//scene.add( ambient );
var
light
=
new
THREE
.
SpotLight
(
0xffeedd
,
1.2
,
650
,
2.5
,
3
);
var
light
=
new
THREE
.
SpotLight
(
0xffeedd
,
1.2
,
650
,
Math
.
PI
/
2
,
3
);
light
.
position
.
set
(
0
,
-
100
,
500
);
light
.
castShadow
=
true
;
...
...
examples/webgl_materials_cubemap_dynamic.html
浏览文件 @
c3768568
...
...
@@ -170,7 +170,7 @@
ambientLight
=
new
THREE
.
AmbientLight
(
0x555555
);
scene
.
add
(
ambientLight
);
spotLight
=
new
THREE
.
SpotLight
(
0xffffff
,
1
,
0
,
Math
.
PI
,
1
);
spotLight
=
new
THREE
.
SpotLight
(
0xffffff
,
1
,
0
,
Math
.
PI
/
2
,
1
);
spotLight
.
position
.
set
(
0
,
1800
,
1500
);
spotLight
.
target
.
position
.
set
(
0
,
0
,
0
);
spotLight
.
castShadow
=
true
;
...
...
examples/webgl_shading_physical.html
浏览文件 @
c3768568
...
...
@@ -316,7 +316,7 @@
pointLight
.
position
.
set
(
0
,
0
,
0
);
scene
.
add
(
pointLight
);
sunLight
=
new
THREE
.
SpotLight
(
0xffffff
,
sunIntensity
,
0
,
Math
.
PI
,
1
);
sunLight
=
new
THREE
.
SpotLight
(
0xffffff
,
sunIntensity
,
0
,
Math
.
PI
/
2
,
1
);
sunLight
.
position
.
set
(
1000
,
2000
,
1000
);
sunLight
.
castShadow
=
true
;
...
...
examples/webgl_shadowmap_performance.html
浏览文件 @
c3768568
...
...
@@ -103,7 +103,7 @@
var
ambient
=
new
THREE
.
AmbientLight
(
0x444444
);
scene
.
add
(
ambient
);
light
=
new
THREE
.
SpotLight
(
0xffffff
,
1
,
0
,
Math
.
PI
,
1
);
light
=
new
THREE
.
SpotLight
(
0xffffff
,
1
,
0
,
Math
.
PI
/
2
,
1
);
light
.
position
.
set
(
0
,
1500
,
1000
);
light
.
target
.
position
.
set
(
0
,
0
,
0
);
...
...
src/extras/helpers/SpotLightHelper.js
浏览文件 @
c3768568
/**
* @author alteredq / http://alteredqualia.com/
* @author mrdoob / http://mrdoob.com/
*/
* @author WestLangley / http://github.com/WestLangley
*/
THREE
.
SpotLightHelper
=
function
(
light
,
sphereSize
)
{
...
...
@@ -31,7 +32,7 @@ THREE.SpotLightHelper = function ( light, sphereSize ) {
this
.
lightCone
.
position
=
this
.
light
.
position
;
var
coneLength
=
light
.
distance
?
light
.
distance
:
10000
;
var
coneWidth
=
coneLength
*
Math
.
tan
(
light
.
angle
*
0.5
)
*
2
;
var
coneWidth
=
coneLength
*
Math
.
tan
(
light
.
angle
)
;
this
.
lightCone
.
scale
.
set
(
coneWidth
,
coneWidth
,
coneLength
);
this
.
lightCone
.
lookAt
(
this
.
light
.
target
.
position
);
...
...
@@ -45,7 +46,7 @@ THREE.SpotLightHelper.prototype = Object.create( THREE.Object3D.prototype );
THREE
.
SpotLightHelper
.
prototype
.
update
=
function
()
{
var
coneLength
=
this
.
light
.
distance
?
this
.
light
.
distance
:
10000
;
var
coneWidth
=
coneLength
*
Math
.
tan
(
this
.
light
.
angle
*
0.5
)
*
2
;
var
coneWidth
=
coneLength
*
Math
.
tan
(
this
.
light
.
angle
)
;
this
.
lightCone
.
scale
.
set
(
coneWidth
,
coneWidth
,
coneLength
);
this
.
lightCone
.
lookAt
(
this
.
light
.
target
.
position
);
...
...
src/lights/SpotLight.js
浏览文件 @
c3768568
...
...
@@ -11,7 +11,7 @@ THREE.SpotLight = function ( hex, intensity, distance, angle, exponent ) {
this
.
intensity
=
(
intensity
!==
undefined
)
?
intensity
:
1
;
this
.
distance
=
(
distance
!==
undefined
)
?
distance
:
0
;
this
.
angle
=
(
angle
!==
undefined
)
?
angle
:
Math
.
PI
/
2
;
this
.
angle
=
(
angle
!==
undefined
)
?
angle
:
Math
.
PI
/
3
;
this
.
exponent
=
(
exponent
!==
undefined
)
?
exponent
:
10
;
this
.
castShadow
=
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录