Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
3ded4a40
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,发现更多精彩内容 >>
提交
3ded4a40
编写于
11月 19, 2011
作者:
A
alteredq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Changed Projector to use Frustum.
Also some bugfixes in ShadowMapPlugin and SpritePlugin.
上级
0c78ae95
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
777 addition
and
837 deletion
+777
-837
build/Three.js
build/Three.js
+355
-357
build/custom/ThreeCanvas.js
build/custom/ThreeCanvas.js
+60
-62
build/custom/ThreeDOM.js
build/custom/ThreeDOM.js
+20
-22
build/custom/ThreeExtras.js
build/custom/ThreeExtras.js
+116
-117
build/custom/ThreeSVG.js
build/custom/ThreeSVG.js
+32
-34
build/custom/ThreeWebGL.js
build/custom/ThreeWebGL.js
+174
-175
src/core/Projector.js
src/core/Projector.js
+3
-44
src/extras/plugins/ShadowMapPlugin.js
src/extras/plugins/ShadowMapPlugin.js
+1
-15
src/extras/plugins/SpritePlugin.js
src/extras/plugins/SpritePlugin.js
+0
-1
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+16
-10
未找到文件。
build/Three.js
浏览文件 @
3ded4a40
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
build/custom/ThreeCanvas.js
浏览文件 @
3ded4a40
此差异已折叠。
点击以展开。
build/custom/ThreeDOM.js
浏览文件 @
3ded4a40
此差异已折叠。
点击以展开。
build/custom/ThreeExtras.js
浏览文件 @
3ded4a40
此差异已折叠。
点击以展开。
build/custom/ThreeSVG.js
浏览文件 @
3ded4a40
此差异已折叠。
点击以展开。
build/custom/ThreeWebGL.js
浏览文件 @
3ded4a40
此差异已折叠。
点击以展开。
src/core/Projector.js
浏览文件 @
3ded4a40
...
...
@@ -20,38 +20,13 @@ THREE.Projector = function() {
_projScreenMatrix
=
new
THREE
.
Matrix4
(),
_projScreenobjectMatrixWorld
=
new
THREE
.
Matrix4
(),
_frustum
=
[
new
THREE
.
Vector4
(),
new
THREE
.
Vector4
(),
new
THREE
.
Vector4
(),
new
THREE
.
Vector4
(),
new
THREE
.
Vector4
(),
new
THREE
.
Vector4
()
],
_frustum
=
new
THREE
.
Frustum
(),
_clippedVertex1PositionScreen
=
new
THREE
.
Vector4
(),
_clippedVertex2PositionScreen
=
new
THREE
.
Vector4
(),
_face3VertexNormals
;
this
.
computeFrustum
=
function
(
m
)
{
_frustum
[
0
].
set
(
m
.
n41
-
m
.
n11
,
m
.
n42
-
m
.
n12
,
m
.
n43
-
m
.
n13
,
m
.
n44
-
m
.
n14
);
_frustum
[
1
].
set
(
m
.
n41
+
m
.
n11
,
m
.
n42
+
m
.
n12
,
m
.
n43
+
m
.
n13
,
m
.
n44
+
m
.
n14
);
_frustum
[
2
].
set
(
m
.
n41
+
m
.
n21
,
m
.
n42
+
m
.
n22
,
m
.
n43
+
m
.
n23
,
m
.
n44
+
m
.
n24
);
_frustum
[
3
].
set
(
m
.
n41
-
m
.
n21
,
m
.
n42
-
m
.
n22
,
m
.
n43
-
m
.
n23
,
m
.
n44
-
m
.
n24
);
_frustum
[
4
].
set
(
m
.
n41
-
m
.
n31
,
m
.
n42
-
m
.
n32
,
m
.
n43
-
m
.
n33
,
m
.
n44
-
m
.
n34
);
_frustum
[
5
].
set
(
m
.
n41
+
m
.
n31
,
m
.
n42
+
m
.
n32
,
m
.
n43
+
m
.
n33
,
m
.
n44
+
m
.
n34
);
for
(
var
i
=
0
;
i
<
6
;
i
++
)
{
var
plane
=
_frustum
[
i
];
plane
.
divideScalar
(
Math
.
sqrt
(
plane
.
x
*
plane
.
x
+
plane
.
y
*
plane
.
y
+
plane
.
z
*
plane
.
z
)
);
}
}
this
.
projectVector
=
function
(
vector
,
camera
)
{
camera
.
matrixWorldInverse
.
getInverse
(
camera
.
matrixWorld
);
...
...
@@ -111,7 +86,7 @@ THREE.Projector = function() {
if
(
object
.
visible
===
false
)
return
;
if
(
(
object
instanceof
THREE
.
Mesh
||
object
instanceof
THREE
.
Line
)
&&
(
object
.
frustumCulled
===
false
||
isInFrustum
(
object
)
)
)
{
(
object
.
frustumCulled
===
false
||
_frustum
.
contains
(
object
)
)
)
{
_projScreenMatrix
.
multiplyVector3
(
_vector3
.
copy
(
object
.
position
)
);
...
...
@@ -182,7 +157,7 @@ THREE.Projector = function() {
_projScreenMatrix
.
multiply
(
camera
.
projectionMatrix
,
camera
.
matrixWorldInverse
);
this
.
computeFrustum
(
_projScreenMatrix
);
_frustum
.
setFromMatrix
(
_projScreenMatrix
);
_renderData
=
this
.
projectGraph
(
scene
,
false
);
...
...
@@ -474,22 +449,6 @@ THREE.Projector = function() {
}
function
isInFrustum
(
object
)
{
var
distance
,
matrix
=
object
.
matrixWorld
,
radius
=
-
object
.
geometry
.
boundingSphere
.
radius
*
Math
.
max
(
object
.
scale
.
x
,
Math
.
max
(
object
.
scale
.
y
,
object
.
scale
.
z
)
);
for
(
var
i
=
0
;
i
<
6
;
i
++
)
{
distance
=
_frustum
[
i
].
x
*
matrix
.
n14
+
_frustum
[
i
].
y
*
matrix
.
n24
+
_frustum
[
i
].
z
*
matrix
.
n34
+
_frustum
[
i
].
w
;
if
(
distance
<=
radius
)
return
false
;
}
return
true
;
};
function
clipLine
(
s1
,
s2
)
{
var
alpha1
=
0
,
alpha2
=
1
,
...
...
src/extras/plugins/ShadowMapPlugin.js
浏览文件 @
3ded4a40
...
...
@@ -203,8 +203,6 @@ THREE.ShadowMapPlugin = function ( ) {
if
(
object
.
visible
&&
object
.
castShadow
)
{
_currentGeometryGroupHash
=
-
1
;
if
(
object
.
matrixAutoUpdate
)
{
object
.
matrixWorld
.
flattenToArray
(
object
.
_objectMatrixArray
);
...
...
@@ -213,19 +211,7 @@ THREE.ShadowMapPlugin = function ( ) {
object
.
_modelViewMatrix
.
multiplyToArray
(
_cameraLight
.
matrixWorldInverse
,
object
.
matrixWorld
,
object
.
_modelViewMatrixArray
);
_renderer
.
setObjectFaces
(
object
);
program
=
_renderer
.
setProgram
(
_cameraLight
,
lights
,
fog
,
_depthMaterial
,
object
);
if
(
object
.
immediateRenderCallback
)
{
object
.
immediateRenderCallback
(
program
,
_gl
,
_frustum
);
}
else
{
object
.
render
(
function
(
object
)
{
_renderer
.
renderBufferImmediate
(
object
,
program
,
_depthMaterial
.
shading
);
}
);
}
_renderer
.
renderImmediateObject
(
_cameraLight
,
lights
,
fog
,
_depthMaterial
,
object
);
}
...
...
src/extras/plugins/SpritePlugin.js
浏览文件 @
3ded4a40
...
...
@@ -92,7 +92,6 @@ THREE.SpritePlugin = function ( ) {
// setup gl
_gl
.
useProgram
(
_sprite
.
program
);
_currentProgram
=
_sprite
.
program
;
if
(
!
_sprite
.
attributesEnabled
)
{
...
...
src/renderers/WebGLRenderer.js
浏览文件 @
3ded4a40
...
...
@@ -3277,8 +3277,6 @@ THREE.WebGLRenderer = function ( parameters ) {
if
(
object
.
visible
)
{
_currentGeometryGroupHash
=
-
1
;
if
(
overrideMaterial
)
{
material
=
overrideMaterial
;
...
...
@@ -3297,21 +3295,29 @@ THREE.WebGLRenderer = function ( parameters ) {
}
_this
.
setObjectFaces
(
object
);
_this
.
renderImmediateObject
(
camera
,
lights
,
fog
,
material
,
object
);
program
=
setProgram
(
camera
,
lights
,
fog
,
material
,
object
);
}
if
(
object
.
immediateRenderCallback
)
{
}
object
.
immediateRenderCallback
(
program
,
_gl
,
_frustum
)
;
}
;
}
else
{
this
.
renderImmediateObject
=
function
(
camera
,
lights
,
fog
,
material
,
object
)
{
object
.
render
(
function
(
object
)
{
_this
.
renderBufferImmediate
(
object
,
program
,
material
.
shading
);
}
);
var
program
=
setProgram
(
camera
,
lights
,
fog
,
material
,
object
);
}
_currentGeometryGroupHash
=
-
1
;
}
_this
.
setObjectFaces
(
object
);
if
(
object
.
immediateRenderCallback
)
{
object
.
immediateRenderCallback
(
program
,
_gl
,
_frustum
);
}
else
{
object
.
render
(
function
(
object
)
{
_this
.
renderBufferImmediate
(
object
,
program
,
material
.
shading
);
}
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录