Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
15262507
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,发现更多精彩内容 >>
提交
15262507
编写于
12月 17, 2010
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added a sort parameter to Projector.projectObjects and Projector.projectScene.
上级
fca3aec6
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
419 addition
and
415 deletion
+419
-415
build/Three.js
build/Three.js
+120
-119
build/ThreeDebug.js
build/ThreeDebug.js
+120
-119
build/ThreeExtras.js
build/ThreeExtras.js
+152
-151
src/renderers/Projector.js
src/renderers/Projector.js
+21
-23
utils/build.py
utils/build.py
+6
-3
未找到文件。
build/Three.js
浏览文件 @
15262507
此差异已折叠。
点击以展开。
build/ThreeDebug.js
浏览文件 @
15262507
此差异已折叠。
点击以展开。
build/ThreeExtras.js
浏览文件 @
15262507
此差异已折叠。
点击以展开。
src/renderers/Projector.js
浏览文件 @
15262507
...
...
@@ -6,12 +6,12 @@
THREE
.
Projector
=
function
()
{
var
_renderList
=
null
,
_object
,
_objectCount
,
_objectPool
=
[],
var
_object
,
_objectCount
,
_objectPool
=
[],
_face3
,
_face32
,
_face3Count
,
_face3Pool
=
[],
_line
,
_lineCount
,
_linePool
=
[],
_particle
,
_particleCount
,
_particlePool
=
[],
_vector3
=
new
THREE
.
Vector4
(),
_vector4
=
new
THREE
.
Vector4
(),
_projScreenMatrix
=
new
THREE
.
Matrix4
(),
_projScreenObjectMatrix
=
new
THREE
.
Matrix4
(),
...
...
@@ -21,13 +21,12 @@ THREE.Projector = function() {
_face3VertexNormals
;
this
.
projectObjects
=
function
(
scene
,
camera
)
{
this
.
projectObjects
=
function
(
scene
,
camera
,
sort
)
{
var
o
,
ol
,
objects
,
object
;
var
renderList
=
[],
o
,
ol
,
objects
,
object
;
_renderList
=
[];
_objectCount
=
0
;
_projScreenMatrix
.
multiply
(
camera
.
projectionMatrix
,
camera
.
matrix
);
objects
=
scene
.
objects
;
...
...
@@ -40,35 +39,34 @@ THREE.Projector = function() {
_object
=
_objectPool
[
_objectCount
]
=
_objectPool
[
_objectCount
]
||
new
THREE
.
RenderableObject
();
_vector4
.
copy
(
object
.
position
);
_projScreenMatrix
.
multiplyVector4
(
_vector4
);
// _vector4.multiplyScalar( 1 / _vector4.w );
_vector3
.
copy
(
object
.
position
);
_projScreenMatrix
.
multiplyVector3
(
_vector3
);
_object
.
object
=
object
;
_object
.
z
=
_vector
4
.
z
;
_object
.
z
=
_vector
3
.
z
;
_
renderList
.
push
(
_object
);
renderList
.
push
(
_object
);
_objectCount
++
;
}
_
renderList
.
sort
(
painterSort
);
(
sort
===
undefined
||
sort
===
true
)
&&
renderList
.
sort
(
painterSort
);
return
_
renderList
;
return
renderList
;
};
// TODO: Rename to projectElements? Test also using it with projectObjects to speed up sorting?
this
.
projectScene
=
function
(
scene
,
camera
)
{
this
.
projectScene
=
function
(
scene
,
camera
,
sort
)
{
var
o
,
ol
,
v
,
vl
,
f
,
fl
,
n
,
nl
,
objects
,
object
,
var
renderList
=
[],
o
,
ol
,
v
,
vl
,
f
,
fl
,
n
,
nl
,
objects
,
object
,
objectMatrix
,
objectRotationMatrix
,
objectMaterial
,
objectOverdraw
,
geometry
,
vertices
,
vertex
,
vertexPositionScreen
,
faces
,
face
,
faceVertexNormals
,
normal
,
v1
,
v2
,
v3
,
v4
;
_renderList
=
[];
_face3Count
=
_lineCount
=
_particleCount
=
0
;
camera
.
autoUpdateMatrix
&&
camera
.
updateMatrix
();
...
...
@@ -180,7 +178,7 @@ THREE.Projector = function() {
}
_
renderList
.
push
(
_face3
);
renderList
.
push
(
_face3
);
_face3Count
++
;
...
...
@@ -235,7 +233,7 @@ THREE.Projector = function() {
}
_
renderList
.
push
(
_face3
);
renderList
.
push
(
_face3
);
_face3Count
++
;
...
...
@@ -271,7 +269,7 @@ THREE.Projector = function() {
}
_
renderList
.
push
(
_face32
);
renderList
.
push
(
_face32
);
_face3Count
++
;
...
...
@@ -319,7 +317,7 @@ THREE.Projector = function() {
_line
.
material
=
object
.
material
;
_
renderList
.
push
(
_line
);
renderList
.
push
(
_line
);
_lineCount
++
;
}
...
...
@@ -347,7 +345,7 @@ THREE.Projector = function() {
_particle
.
material
=
object
.
material
;
_
renderList
.
push
(
_particle
);
renderList
.
push
(
_particle
);
_particleCount
++
;
...
...
@@ -357,9 +355,9 @@ THREE.Projector = function() {
}
_
renderList
.
sort
(
painterSort
);
(
sort
===
undefined
||
sort
===
true
)
&&
renderList
.
sort
(
painterSort
);
return
_
renderList
;
return
renderList
;
};
...
...
utils/build.py
浏览文件 @
15262507
...
...
@@ -62,12 +62,13 @@ COMMON_FILES = [
'renderers/CanvasRenderer.js'
,
'renderers/SVGRenderer.js'
,
'renderers/WebGLRenderer.js'
,
'renderers/renderables/RenderableObject.js'
,
'renderers/renderables/RenderableFace3.js'
,
'renderers/renderables/RenderableParticle.js'
,
'renderers/renderables/RenderableLine.js'
]
EXTRAS_FILES
=
[
EXTRAS_FILES
=
[
'extras/GeometryUtils.js'
,
'extras/ImageUtils.js'
,
'extras/SceneUtils.js'
,
...
...
@@ -140,6 +141,7 @@ SVG_FILES = [
'scenes/Scene.js'
,
'renderers/Projector.js'
,
'renderers/SVGRenderer.js'
,
'renderers/renderables/RenderableObject.js'
,
'renderers/renderables/RenderableFace3.js'
,
'renderers/renderables/RenderableParticle.js'
,
'renderers/renderables/RenderableLine.js'
...
...
@@ -190,6 +192,7 @@ CANVAS_FILES = [
'scenes/Scene.js'
,
'renderers/Projector.js'
,
'renderers/CanvasRenderer.js'
,
'renderers/renderables/RenderableObject.js'
,
'renderers/renderables/RenderableFace3.js'
,
'renderers/renderables/RenderableParticle.js'
,
'renderers/renderables/RenderableLine.js'
...
...
@@ -250,7 +253,7 @@ def merge(files):
for
filename
in
files
:
with
open
(
os
.
path
.
join
(
'..'
,
'src'
,
filename
),
'r'
)
as
f
:
buffer
.
append
(
f
.
read
())
return
""
.
join
(
buffer
)
...
...
@@ -374,7 +377,7 @@ def main(argv=None):
[
'ThreeDOM'
,
'includes_dom'
,
DOM_FILES
,
args
.
dom
],
[
'ThreeExtras'
,
'includes_extras'
,
COMMON_FILES
+
EXTRAS_FILES
,
args
.
extras
]
]
for
fname_lib
,
fname_inc
,
files
,
enabled
in
config
:
if
enabled
or
args
.
all
:
buildLib
(
files
,
debug
,
fname_lib
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录