Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
9bec2f03
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 搜索 >>
提交
9bec2f03
编写于
11月 20, 2015
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added intensity to Light (thus AmbientLight). See #7621.
上级
05ade8fe
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
14 addition
and
20 deletion
+14
-20
src/lights/AmbientLight.js
src/lights/AmbientLight.js
+2
-2
src/lights/DirectionalLight.js
src/lights/DirectionalLight.js
+1
-4
src/lights/HemisphereLight.js
src/lights/HemisphereLight.js
+1
-3
src/lights/Light.js
src/lights/Light.js
+5
-2
src/lights/PointLight.js
src/lights/PointLight.js
+1
-3
src/lights/SpotLight.js
src/lights/SpotLight.js
+1
-3
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+3
-3
未找到文件。
src/lights/AmbientLight.js
浏览文件 @
9bec2f03
...
...
@@ -2,9 +2,9 @@
* @author mrdoob / http://mrdoob.com/
*/
THREE
.
AmbientLight
=
function
(
color
)
{
THREE
.
AmbientLight
=
function
(
color
,
intensity
)
{
THREE
.
Light
.
call
(
this
,
color
);
THREE
.
Light
.
call
(
this
,
color
,
intensity
);
this
.
type
=
'
AmbientLight
'
;
...
...
src/lights/DirectionalLight.js
浏览文件 @
9bec2f03
...
...
@@ -5,7 +5,7 @@
THREE
.
DirectionalLight
=
function
(
color
,
intensity
)
{
THREE
.
Light
.
call
(
this
,
color
);
THREE
.
Light
.
call
(
this
,
color
,
intensity
);
this
.
type
=
'
DirectionalLight
'
;
...
...
@@ -14,8 +14,6 @@ THREE.DirectionalLight = function ( color, intensity ) {
this
.
target
=
new
THREE
.
Object3D
();
this
.
intensity
=
(
intensity
!==
undefined
)
?
intensity
:
1
;
this
.
shadow
=
new
THREE
.
LightShadow
(
new
THREE
.
OrthographicCamera
(
-
500
,
500
,
500
,
-
500
,
50
,
5000
)
);
};
...
...
@@ -27,7 +25,6 @@ THREE.DirectionalLight.prototype.copy = function ( source ) {
THREE
.
Light
.
prototype
.
copy
.
call
(
this
,
source
);
this
.
intensity
=
source
.
intensity
;
this
.
target
=
source
.
target
.
clone
();
this
.
shadow
=
source
.
shadow
.
clone
();
...
...
src/lights/HemisphereLight.js
浏览文件 @
9bec2f03
...
...
@@ -4,7 +4,7 @@
THREE
.
HemisphereLight
=
function
(
skyColor
,
groundColor
,
intensity
)
{
THREE
.
Light
.
call
(
this
,
skyColor
);
THREE
.
Light
.
call
(
this
,
skyColor
,
intensity
);
this
.
type
=
'
HemisphereLight
'
;
...
...
@@ -14,7 +14,6 @@ THREE.HemisphereLight = function ( skyColor, groundColor, intensity ) {
this
.
updateMatrix
();
this
.
groundColor
=
new
THREE
.
Color
(
groundColor
);
this
.
intensity
=
(
intensity
!==
undefined
)
?
intensity
:
1
;
};
...
...
@@ -26,7 +25,6 @@ THREE.HemisphereLight.prototype.copy = function ( source ) {
THREE
.
Light
.
prototype
.
copy
.
call
(
this
,
source
);
this
.
groundColor
.
copy
(
source
.
groundColor
);
this
.
intensity
=
source
.
intensity
;
return
this
;
...
...
src/lights/Light.js
浏览文件 @
9bec2f03
...
...
@@ -3,13 +3,14 @@
* @author alteredq / http://alteredqualia.com/
*/
THREE
.
Light
=
function
(
color
)
{
THREE
.
Light
=
function
(
color
,
intensity
)
{
THREE
.
Object3D
.
call
(
this
);
this
.
type
=
'
Light
'
;
this
.
color
=
new
THREE
.
Color
(
color
);
this
.
intensity
=
intensity
!==
undefined
?
intensity
:
1
;
this
.
receiveShadow
=
undefined
;
...
...
@@ -23,6 +24,7 @@ THREE.Light.prototype.copy = function ( source ) {
THREE
.
Object3D
.
prototype
.
copy
.
call
(
this
,
source
);
this
.
color
.
copy
(
source
.
color
);
this
.
intensity
=
source
.
intensity
;
return
this
;
...
...
@@ -33,9 +35,10 @@ THREE.Light.prototype.toJSON = function ( meta ) {
var
data
=
THREE
.
Object3D
.
prototype
.
toJSON
.
call
(
this
,
meta
);
data
.
object
.
color
=
this
.
color
.
getHex
();
data
.
object
.
intensity
=
this
.
intensity
;
if
(
this
.
groundColor
!==
undefined
)
data
.
object
.
groundColor
=
this
.
groundColor
.
getHex
();
if
(
this
.
intensity
!==
undefined
)
data
.
object
.
intensity
=
this
.
intensity
;
if
(
this
.
distance
!==
undefined
)
data
.
object
.
distance
=
this
.
distance
;
if
(
this
.
angle
!==
undefined
)
data
.
object
.
angle
=
this
.
angle
;
if
(
this
.
decay
!==
undefined
)
data
.
object
.
decay
=
this
.
decay
;
...
...
src/lights/PointLight.js
浏览文件 @
9bec2f03
...
...
@@ -5,11 +5,10 @@
THREE
.
PointLight
=
function
(
color
,
intensity
,
distance
,
decay
)
{
THREE
.
Light
.
call
(
this
,
color
);
THREE
.
Light
.
call
(
this
,
color
,
intensity
);
this
.
type
=
'
PointLight
'
;
this
.
intensity
=
(
intensity
!==
undefined
)
?
intensity
:
1
;
this
.
distance
=
(
distance
!==
undefined
)
?
distance
:
0
;
this
.
decay
=
(
decay
!==
undefined
)
?
decay
:
1
;
// for physically correct lights, should be 2.
...
...
@@ -24,7 +23,6 @@ THREE.PointLight.prototype.copy = function ( source ) {
THREE
.
Light
.
prototype
.
copy
.
call
(
this
,
source
);
this
.
intensity
=
source
.
intensity
;
this
.
distance
=
source
.
distance
;
this
.
decay
=
source
.
decay
;
...
...
src/lights/SpotLight.js
浏览文件 @
9bec2f03
...
...
@@ -4,7 +4,7 @@
THREE
.
SpotLight
=
function
(
color
,
intensity
,
distance
,
angle
,
exponent
,
decay
)
{
THREE
.
Light
.
call
(
this
,
color
);
THREE
.
Light
.
call
(
this
,
color
,
intensity
);
this
.
type
=
'
SpotLight
'
;
...
...
@@ -13,7 +13,6 @@ THREE.SpotLight = function ( color, intensity, distance, angle, exponent, decay
this
.
target
=
new
THREE
.
Object3D
();
this
.
intensity
=
(
intensity
!==
undefined
)
?
intensity
:
1
;
this
.
distance
=
(
distance
!==
undefined
)
?
distance
:
0
;
this
.
angle
=
(
angle
!==
undefined
)
?
angle
:
Math
.
PI
/
3
;
this
.
exponent
=
(
exponent
!==
undefined
)
?
exponent
:
10
;
...
...
@@ -30,7 +29,6 @@ THREE.SpotLight.prototype.copy = function ( source ) {
THREE
.
Light
.
prototype
.
copy
.
call
(
this
,
source
);
this
.
intensity
=
source
.
intensity
;
this
.
distance
=
source
.
distance
;
this
.
angle
=
source
.
angle
;
this
.
exponent
=
source
.
exponent
;
...
...
src/renderers/WebGLRenderer.js
浏览文件 @
9bec2f03
...
...
@@ -2663,9 +2663,9 @@ THREE.WebGLRenderer = function ( parameters ) {
if
(
light
instanceof
THREE
.
AmbientLight
)
{
r
+=
color
.
r
;
g
+=
color
.
g
;
b
+=
color
.
b
;
r
+=
color
.
r
*
intensity
;
g
+=
color
.
g
*
intensity
;
b
+=
color
.
b
*
intensity
;
}
else
if
(
light
instanceof
THREE
.
DirectionalLight
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录