Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
28ad7aa2
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,发现更多精彩内容 >>
提交
28ad7aa2
编写于
2月 20, 2012
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Renamed scene.objects to scene.__objects and fixed all the examples that relied on it.
上级
4e2f5aaa
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
69 addition
and
45 deletion
+69
-45
examples/misc_lights_test.html
examples/misc_lights_test.html
+13
-7
examples/webgl_geometry_shapes.html
examples/webgl_geometry_shapes.html
+2
-2
examples/webgl_lines_colors.html
examples/webgl_lines_colors.html
+3
-2
examples/webgl_lines_cubes.html
examples/webgl_lines_cubes.html
+3
-2
examples/webgl_lines_sphere.html
examples/webgl_lines_sphere.html
+9
-3
examples/webgl_lines_splines.html
examples/webgl_lines_splines.html
+8
-2
examples/webgl_particles_billboards.html
examples/webgl_particles_billboards.html
+0
-8
examples/webgl_particles_random.html
examples/webgl_particles_random.html
+9
-3
examples/webgl_particles_sprites.html
examples/webgl_particles_sprites.html
+9
-3
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+3
-3
src/scenes/Scene.js
src/scenes/Scene.js
+10
-10
未找到文件。
examples/misc_lights_test.html
浏览文件 @
28ad7aa2
...
...
@@ -190,19 +190,25 @@
camera
.
lookAt
(
scene
.
position
);
for
(
var
i
=
0
,
l
=
scene
.
objects
.
length
;
i
<
l
;
i
++
)
{
for
(
var
i
=
0
,
l
=
scene
.
children
.
length
;
i
<
l
;
i
++
)
{
if
(
i
%
3
==
1
)
var
object
=
scene
.
children
[
i
];
scene
.
objects
[
i
].
rotation
.
z
+=
0.05
;
if
(
object
instanceof
THREE
.
Mesh
)
{
else
if
(
i
%
3
==
2
)
if
(
i
%
3
==
1
)
scene
.
objects
[
i
].
rotation
.
y
+=
0.05
;
object
.
rotation
.
z
+=
0.05
;
else
if
(
i
%
3
==
0
)
else
if
(
i
%
3
==
2
)
scene
.
objects
[
i
].
rotation
.
x
+=
0.05
;
object
.
rotation
.
y
+=
0.05
;
else
if
(
i
%
3
==
0
)
object
.
rotation
.
x
+=
0.05
;
}
}
...
...
examples/webgl_geometry_shapes.html
浏览文件 @
28ad7aa2
...
...
@@ -369,8 +369,8 @@
//
renderer
=
new
THREE
.
WebGLRenderer
(
{
antialias
:
true
,
clearColor
:
0xf0f0f0
}
);
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
renderer
=
new
THREE
.
WebGLRenderer
(
{
antialias
:
true
}
);
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
container
.
appendChild
(
renderer
.
domElement
);
...
...
examples/webgl_lines_colors.html
浏览文件 @
28ad7aa2
...
...
@@ -269,9 +269,10 @@
var
time
=
Date
.
now
()
*
0.0005
;
for
(
var
i
=
0
;
i
<
scene
.
objects
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
scene
.
children
.
length
;
i
++
)
{
scene
.
objects
[
i
].
rotation
.
y
=
time
*
(
i
%
2
?
1
:
-
1
);
var
object
=
scene
.
children
[
i
];
if
(
object
instanceof
THREE
.
Line
)
object
.
rotation
.
y
=
time
*
(
i
%
2
?
1
:
-
1
);
}
...
...
examples/webgl_lines_cubes.html
浏览文件 @
28ad7aa2
...
...
@@ -218,9 +218,10 @@
var
time
=
Date
.
now
()
*
0.0015
;
for
(
var
i
=
0
;
i
<
scene
.
objects
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
scene
.
children
.
length
;
i
++
)
{
scene
.
objects
[
i
].
rotation
.
y
=
time
*
(
i
%
2
?
1
:
-
1
);
var
object
=
scene
.
children
[
i
];
if
(
object
instanceof
THREE
.
Line
)
object
.
rotation
.
y
=
time
*
(
i
%
2
?
1
:
-
1
);
}
...
...
examples/webgl_lines_sphere.html
浏览文件 @
28ad7aa2
...
...
@@ -176,11 +176,17 @@
var
time
=
Date
.
now
()
*
0.0001
;
for
(
var
i
=
0
;
i
<
scene
.
objects
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
scene
.
children
.
length
;
i
++
)
{
scene
.
objects
[
i
].
rotation
.
y
=
time
*
(
i
<
4
?
(
i
+
1
)
:
-
(
i
+
1
)
)
;
var
object
=
scene
.
children
[
i
]
;
if
(
i
<
5
)
scene
.
objects
[
i
].
scale
.
x
=
scene
.
objects
[
i
].
scale
.
y
=
scene
.
objects
[
i
].
scale
.
z
=
scene
.
objects
[
i
].
originalScale
*
(
i
/
5
+
1
)
*
(
1
+
0.5
*
Math
.
sin
(
7
*
time
)
);
if
(
object
instanceof
THREE
.
Line
)
{
object
.
rotation
.
y
=
time
*
(
i
<
4
?
(
i
+
1
)
:
-
(
i
+
1
)
);
if
(
i
<
5
)
object
.
scale
.
x
=
object
.
scale
.
y
=
object
.
scale
.
z
=
object
.
originalScale
*
(
i
/
5
+
1
)
*
(
1
+
0.5
*
Math
.
sin
(
7
*
time
)
);
}
}
...
...
examples/webgl_lines_splines.html
浏览文件 @
28ad7aa2
...
...
@@ -247,9 +247,15 @@
var
time
=
Date
.
now
()
*
0.0005
;
for
(
var
i
=
0
;
i
<
scene
.
objects
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
scene
.
children
.
length
;
i
++
)
{
scene
.
objects
[
i
].
rotation
.
y
=
time
*
(
i
%
2
?
1
:
-
1
);
var
object
=
scene
.
children
[
i
];
if
(
object
instanceof
THREE
.
Line
)
{
object
.
rotation
.
y
=
time
*
(
i
%
2
?
1
:
-
1
);
}
}
...
...
examples/webgl_particles_billboards.html
浏览文件 @
28ad7aa2
...
...
@@ -162,14 +162,6 @@
camera
.
lookAt
(
scene
.
position
);
/*
for( i = 0; i < scene.objects.length; i++ ) {
scene.objects[i].rotation.y = 5*time * ( i < 4 ? i+1 : - (i+1) );
}
*/
h
=
(
360
*
(
1.0
+
time
)
%
360
)
/
360
;
material
.
color
.
setHSV
(
h
,
0.75
,
0.8
);
...
...
examples/webgl_particles_random.html
浏览文件 @
28ad7aa2
...
...
@@ -167,13 +167,19 @@
camera
.
lookAt
(
scene
.
position
);
for
(
i
=
0
;
i
<
scene
.
objects
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
scene
.
children
.
length
;
i
++
)
{
scene
.
objects
[
i
].
rotation
.
y
=
time
*
(
i
<
4
?
i
+
1
:
-
(
i
+
1
)
);
var
object
=
scene
.
children
[
i
];
if
(
object
instanceof
THREE
.
ParticleSystem
)
{
object
.
rotation
.
y
=
time
*
(
i
<
4
?
i
+
1
:
-
(
i
+
1
)
);
}
}
for
(
i
=
0
;
i
<
materials
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
materials
.
length
;
i
++
)
{
color
=
parameters
[
i
][
0
];
...
...
examples/webgl_particles_sprites.html
浏览文件 @
28ad7aa2
...
...
@@ -176,13 +176,19 @@
camera
.
lookAt
(
scene
.
position
);
for
(
i
=
0
;
i
<
scene
.
objects
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
scene
.
children
.
length
;
i
++
)
{
scene
.
objects
[
i
].
rotation
.
y
=
time
*
(
i
<
4
?
i
+
1
:
-
(
i
+
1
)
);
var
object
=
scene
.
children
[
i
];
if
(
object
instanceof
THREE
.
ParticleSystem
)
{
object
.
rotation
.
y
=
time
*
(
i
<
4
?
i
+
1
:
-
(
i
+
1
)
);
}
}
for
(
i
=
0
;
i
<
materials
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
materials
.
length
;
i
++
)
{
color
=
parameters
[
i
][
0
];
...
...
src/renderers/WebGLRenderer.js
浏览文件 @
28ad7aa2
...
...
@@ -3269,7 +3269,7 @@ THREE.WebGLRenderer = function ( parameters ) {
webglObject
,
object
,
renderList
,
lights
=
scene
.
lights
,
lights
=
scene
.
__
lights
,
fog
=
scene
.
fog
;
_currentMaterialId
=
-
1
;
...
...
@@ -4298,7 +4298,7 @@ THREE.WebGLRenderer = function ( parameters ) {
};
function
setMaterialShaders
(
material
,
shaders
)
{
function
setMaterialShaders
(
material
,
shaders
)
{
material
.
uniforms
=
THREE
.
UniformsUtils
.
clone
(
shaders
.
uniforms
);
material
.
vertexShader
=
shaders
.
vertexShader
;
...
...
@@ -4306,7 +4306,7 @@ THREE.WebGLRenderer = function ( parameters ) {
};
function
setProgram
(
camera
,
lights
,
fog
,
material
,
object
)
{
function
setProgram
(
camera
,
lights
,
fog
,
material
,
object
)
{
if
(
!
material
.
program
)
{
...
...
src/scenes/Scene.js
浏览文件 @
28ad7aa2
...
...
@@ -11,8 +11,8 @@ THREE.Scene = function () {
this
.
matrixAutoUpdate
=
false
;
this
.
objects
=
[];
this
.
lights
=
[];
this
.
__
objects
=
[];
this
.
__
lights
=
[];
this
.
__objectsAdded
=
[];
this
.
__objectsRemoved
=
[];
...
...
@@ -26,17 +26,17 @@ THREE.Scene.prototype.addObject = function ( object ) {
if
(
object
instanceof
THREE
.
Light
)
{
if
(
this
.
lights
.
indexOf
(
object
)
===
-
1
)
{
if
(
this
.
__
lights
.
indexOf
(
object
)
===
-
1
)
{
this
.
lights
.
push
(
object
);
this
.
__
lights
.
push
(
object
);
}
}
else
if
(
!
(
object
instanceof
THREE
.
Camera
||
object
instanceof
THREE
.
Bone
)
)
{
if
(
this
.
objects
.
indexOf
(
object
)
===
-
1
)
{
if
(
this
.
__
objects
.
indexOf
(
object
)
===
-
1
)
{
this
.
objects
.
push
(
object
);
this
.
__
objects
.
push
(
object
);
this
.
__objectsAdded
.
push
(
object
);
// check if previously removed
...
...
@@ -65,21 +65,21 @@ THREE.Scene.prototype.removeObject = function ( object ) {
if
(
object
instanceof
THREE
.
Light
)
{
var
i
=
this
.
lights
.
indexOf
(
object
);
var
i
=
this
.
__
lights
.
indexOf
(
object
);
if
(
i
!==
-
1
)
{
this
.
lights
.
splice
(
i
,
1
);
this
.
__
lights
.
splice
(
i
,
1
);
}
}
else
if
(
!
(
object
instanceof
THREE
.
Camera
)
)
{
var
i
=
this
.
objects
.
indexOf
(
object
);
var
i
=
this
.
__
objects
.
indexOf
(
object
);
if
(
i
!==
-
1
)
{
this
.
objects
.
splice
(
i
,
1
);
this
.
__
objects
.
splice
(
i
,
1
);
this
.
__objectsRemoved
.
push
(
object
);
// check if previously added
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录