Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
078b0977
T
three.js
项目概览
车家大少爷
/
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,发现更多精彩内容 >>
提交
078b0977
编写于
2月 12, 2011
作者:
A
alteredq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Few dirty performance optimizations.
WebGLRenderer now as fast as WebGLRenderer2.
上级
fe70e245
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
394 addition
and
305 deletion
+394
-305
build/Three.js
build/Three.js
+88
-86
build/ThreeDebug.js
build/ThreeDebug.js
+88
-86
build/ThreeExtras.js
build/ThreeExtras.js
+126
-124
src/core/Matrix3.js
src/core/Matrix3.js
+18
-0
src/core/Matrix4.js
src/core/Matrix4.js
+56
-0
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+18
-9
未找到文件。
build/Three.js
浏览文件 @
078b0977
此差异已折叠。
点击以展开。
build/ThreeDebug.js
浏览文件 @
078b0977
此差异已折叠。
点击以展开。
build/ThreeExtras.js
浏览文件 @
078b0977
此差异已折叠。
点击以展开。
src/core/Matrix3.js
浏览文件 @
078b0977
...
...
@@ -16,6 +16,24 @@ THREE.Matrix3.prototype = {
return
this
;
},
transposeIntoArray
:
function
(
r
)
{
var
m
=
this
.
m
;
r
[
0
]
=
m
[
0
];
r
[
1
]
=
m
[
3
];
r
[
2
]
=
m
[
6
];
r
[
3
]
=
m
[
1
];
r
[
4
]
=
m
[
4
];
r
[
5
]
=
m
[
7
];
r
[
6
]
=
m
[
2
];
r
[
7
]
=
m
[
5
];
r
[
8
]
=
m
[
8
];
return
this
;
}
};
src/core/Matrix4.js
浏览文件 @
078b0977
...
...
@@ -146,6 +146,62 @@ THREE.Matrix4.prototype = {
},
multiplyToArray
:
function
(
a
,
b
,
r
)
{
var
a11
=
a
.
n11
,
a12
=
a
.
n12
,
a13
=
a
.
n13
,
a14
=
a
.
n14
,
a21
=
a
.
n21
,
a22
=
a
.
n22
,
a23
=
a
.
n23
,
a24
=
a
.
n24
,
a31
=
a
.
n31
,
a32
=
a
.
n32
,
a33
=
a
.
n33
,
a34
=
a
.
n34
,
a41
=
a
.
n41
,
a42
=
a
.
n42
,
a43
=
a
.
n43
,
a44
=
a
.
n44
,
b11
=
b
.
n11
,
b12
=
b
.
n12
,
b13
=
b
.
n13
,
b14
=
b
.
n14
,
b21
=
b
.
n21
,
b22
=
b
.
n22
,
b23
=
b
.
n23
,
b24
=
b
.
n24
,
b31
=
b
.
n31
,
b32
=
b
.
n32
,
b33
=
b
.
n33
,
b34
=
b
.
n34
,
b41
=
b
.
n41
,
b42
=
b
.
n42
,
b43
=
b
.
n43
,
b44
=
b
.
n44
;
this
.
n11
=
a11
*
b11
+
a12
*
b21
+
a13
*
b31
+
a14
*
b41
;
this
.
n12
=
a11
*
b12
+
a12
*
b22
+
a13
*
b32
+
a14
*
b42
;
this
.
n13
=
a11
*
b13
+
a12
*
b23
+
a13
*
b33
+
a14
*
b43
;
this
.
n14
=
a11
*
b14
+
a12
*
b24
+
a13
*
b34
+
a14
*
b44
;
this
.
n21
=
a21
*
b11
+
a22
*
b21
+
a23
*
b31
+
a24
*
b41
;
this
.
n22
=
a21
*
b12
+
a22
*
b22
+
a23
*
b32
+
a24
*
b42
;
this
.
n23
=
a21
*
b13
+
a22
*
b23
+
a23
*
b33
+
a24
*
b43
;
this
.
n24
=
a21
*
b14
+
a22
*
b24
+
a23
*
b34
+
a24
*
b44
;
this
.
n31
=
a31
*
b11
+
a32
*
b21
+
a33
*
b31
+
a34
*
b41
;
this
.
n32
=
a31
*
b12
+
a32
*
b22
+
a33
*
b32
+
a34
*
b42
;
this
.
n33
=
a31
*
b13
+
a32
*
b23
+
a33
*
b33
+
a34
*
b43
;
this
.
n34
=
a31
*
b14
+
a32
*
b24
+
a33
*
b34
+
a34
*
b44
;
this
.
n41
=
a41
*
b11
+
a42
*
b21
+
a43
*
b31
+
a44
*
b41
;
this
.
n42
=
a41
*
b12
+
a42
*
b22
+
a43
*
b32
+
a44
*
b42
;
this
.
n43
=
a41
*
b13
+
a42
*
b23
+
a43
*
b33
+
a44
*
b43
;
this
.
n44
=
a41
*
b14
+
a42
*
b24
+
a43
*
b34
+
a44
*
b44
;
r
[
0
]
=
this
.
n11
;
r
[
1
]
=
this
.
n21
;
r
[
2
]
=
this
.
n31
;
r
[
3
]
=
this
.
n41
;
r
[
4
]
=
this
.
n12
;
r
[
5
]
=
this
.
n22
;
r
[
6
]
=
this
.
n32
;
r
[
7
]
=
this
.
n42
;
r
[
8
]
=
this
.
n13
;
r
[
9
]
=
this
.
n23
;
r
[
10
]
=
this
.
n33
;
r
[
11
]
=
this
.
n43
;
r
[
12
]
=
this
.
n14
;
r
[
13
]
=
this
.
n24
;
r
[
14
]
=
this
.
n34
;
r
[
15
]
=
this
.
n44
;
return
this
;
},
multiplySelf
:
function
(
m
)
{
var
n11
=
this
.
n11
,
n12
=
this
.
n12
,
n13
=
this
.
n13
,
n14
=
this
.
n14
,
...
...
src/renderers/WebGLRenderer.js
浏览文件 @
078b0977
...
...
@@ -1486,7 +1486,13 @@ THREE.WebGLRenderer = function ( parameters ) {
if
(
object
.
visible
&&
(
!
(
object
instanceof
THREE
.
Mesh
)
||
isInFrustum
(
object
)
)
)
{
object
.
autoUpdateMatrix
&&
object
.
updateMatrix
();
if
(
object
.
autoUpdateMatrix
)
{
object
.
updateMatrix
();
object
.
_objectMatrixArray
.
set
(
object
.
matrix
.
flatten
()
);
}
this
.
setupMatrices
(
object
,
camera
);
webGLObject
.
render
=
true
;
...
...
@@ -1507,7 +1513,13 @@ THREE.WebGLRenderer = function ( parameters ) {
if
(
object
.
visible
)
{
object
.
autoUpdateMatrix
&&
object
.
updateMatrix
();
if
(
object
.
autoUpdateMatrix
)
{
object
.
updateMatrix
();
object
.
_objectMatrixArray
.
set
(
object
.
matrix
.
flatten
()
);
}
this
.
setupMatrices
(
object
,
camera
);
}
...
...
@@ -1656,6 +1668,8 @@ THREE.WebGLRenderer = function ( parameters ) {
object
.
_normalMatrixArray
=
new
Float32Array
(
9
);
object
.
_modelViewMatrixArray
=
new
Float32Array
(
16
);
object
.
_objectMatrixArray
=
new
Float32Array
(
16
);
object
.
_objectMatrixArray
.
set
(
object
.
matrix
.
flatten
()
);
}
...
...
@@ -1790,13 +1804,8 @@ THREE.WebGLRenderer = function ( parameters ) {
this
.
setupMatrices
=
function
(
object
,
camera
)
{
object
.
_modelViewMatrix
.
multiply
(
camera
.
matrix
,
object
.
matrix
);
object
.
_modelViewMatrixArray
.
set
(
object
.
_modelViewMatrix
.
flatten
()
);
object
.
_normalMatrix
=
THREE
.
Matrix4
.
makeInvert3x3
(
object
.
_modelViewMatrix
).
transpose
();
object
.
_normalMatrixArray
.
set
(
object
.
_normalMatrix
.
m
);
object
.
_objectMatrixArray
.
set
(
object
.
matrix
.
flatten
()
);
object
.
_modelViewMatrix
.
multiplyToArray
(
camera
.
matrix
,
object
.
matrix
,
object
.
_modelViewMatrixArray
);
object
.
_normalMatrix
=
THREE
.
Matrix4
.
makeInvert3x3
(
object
.
_modelViewMatrix
).
transposeIntoArray
(
object
.
_normalMatrixArray
);
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录