Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fktz008
three.js
提交
55e0a843
T
three.js
项目概览
fktz008
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
提交
55e0a843
编写于
2月 08, 2012
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Projector now negates (inverts?) the normals when culled and flipSided || doubleSided. Fixes #1270.
上级
b716ed40
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
683 addition
and
665 deletion
+683
-665
build/Three.js
build/Three.js
+272
-272
build/custom/ThreeCanvas.js
build/custom/ThreeCanvas.js
+48
-47
build/custom/ThreeDOM.js
build/custom/ThreeDOM.js
+23
-23
build/custom/ThreeExtras.js
build/custom/ThreeExtras.js
+139
-140
build/custom/ThreeSVG.js
build/custom/ThreeSVG.js
+34
-34
build/custom/ThreeWebGL.js
build/custom/ThreeWebGL.js
+125
-124
examples/canvas_lights_pointlights_smooth.html
examples/canvas_lights_pointlights_smooth.html
+0
-1
src/core/Projector.js
src/core/Projector.js
+42
-24
未找到文件。
build/Three.js
浏览文件 @
55e0a843
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
build/custom/ThreeCanvas.js
浏览文件 @
55e0a843
此差异已折叠。
点击以展开。
build/custom/ThreeDOM.js
浏览文件 @
55e0a843
此差异已折叠。
点击以展开。
build/custom/ThreeExtras.js
浏览文件 @
55e0a843
此差异已折叠。
点击以展开。
build/custom/ThreeSVG.js
浏览文件 @
55e0a843
此差异已折叠。
点击以展开。
build/custom/ThreeWebGL.js
浏览文件 @
55e0a843
此差异已折叠。
点击以展开。
examples/canvas_lights_pointlights_smooth.html
浏览文件 @
55e0a843
...
...
@@ -101,7 +101,6 @@
geometry
.
computeVertexNormals
();
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshLambertMaterial
(
{
color
:
0xffffff
,
overdraw
:
true
}
)
);
mesh
.
overdraw
=
true
;
scene
.
add
(
mesh
);
}
);
...
...
src/core/Projector.js
浏览文件 @
55e0a843
...
...
@@ -130,9 +130,9 @@ THREE.Projector = function() {
this
.
projectScene
=
function
(
scene
,
camera
,
sort
)
{
var
near
=
camera
.
near
,
far
=
camera
.
far
,
var
near
=
camera
.
near
,
far
=
camera
.
far
,
visible
=
false
,
o
,
ol
,
v
,
vl
,
f
,
fl
,
n
,
nl
,
c
,
cl
,
u
,
ul
,
object
,
objectMatrixWorld
,
objectMatrixWorldRotation
,
objectMaterial
,
objectMatrixWorld
,
objectMatrixWorldRotation
,
geometry
,
geometryMaterials
,
vertices
,
vertex
,
vertexPositionScreen
,
faces
,
face
,
faceVertexNormals
,
normal
,
faceVertexUvs
,
uvs
,
v1
,
v2
,
v3
,
v4
;
...
...
@@ -166,7 +166,6 @@ THREE.Projector = function() {
object
=
_renderData
.
objects
[
o
].
object
;
objectMatrixWorld
=
object
.
matrixWorld
;
objectMaterial
=
object
.
material
;
_vertexCount
=
0
;
...
...
@@ -207,16 +206,24 @@ THREE.Projector = function() {
v2
=
_vertexPool
[
face
.
b
];
v3
=
_vertexPool
[
face
.
c
];
if
(
v1
.
visible
&&
v2
.
visible
&&
v3
.
visible
&&
(
object
.
doubleSided
||
(
object
.
flipSided
!=
(
v3
.
positionScreen
.
x
-
v1
.
positionScreen
.
x
)
*
(
v2
.
positionScreen
.
y
-
v1
.
positionScreen
.
y
)
-
(
v3
.
positionScreen
.
y
-
v1
.
positionScreen
.
y
)
*
(
v2
.
positionScreen
.
x
-
v1
.
positionScreen
.
x
)
<
0
)
)
)
{
if
(
v1
.
visible
&&
v2
.
visible
&&
v3
.
visible
)
{
_face
=
getNextFace3InPool
();
visible
=
(
(
v3
.
positionScreen
.
x
-
v1
.
positionScreen
.
x
)
*
(
v2
.
positionScreen
.
y
-
v1
.
positionScreen
.
y
)
-
(
v3
.
positionScreen
.
y
-
v1
.
positionScreen
.
y
)
*
(
v2
.
positionScreen
.
x
-
v1
.
positionScreen
.
x
)
)
<
0
;
_face
.
v1
.
copy
(
v1
);
_face
.
v2
.
copy
(
v2
);
_face
.
v3
.
copy
(
v3
);
if
(
object
.
doubleSided
||
visible
!=
object
.
flipSided
)
{
_face
=
getNextFace3InPool
();
_face
.
v1
.
copy
(
v1
);
_face
.
v2
.
copy
(
v2
);
_face
.
v3
.
copy
(
v3
);
}
else
{
continue
;
}
}
else
{
...
...
@@ -231,19 +238,28 @@ THREE.Projector = function() {
v3
=
_vertexPool
[
face
.
c
];
v4
=
_vertexPool
[
face
.
d
];
if
(
v1
.
visible
&&
v2
.
visible
&&
v3
.
visible
&&
v4
.
visible
&&
(
object
.
doubleSided
||
(
object
.
flipSided
!=
(
(
v4
.
positionScreen
.
x
-
v1
.
positionScreen
.
x
)
*
(
v2
.
positionScreen
.
y
-
v1
.
positionScreen
.
y
)
-
(
v4
.
positionScreen
.
y
-
v1
.
positionScreen
.
y
)
*
(
v2
.
positionScreen
.
x
-
v1
.
positionScreen
.
x
)
<
0
||
(
v2
.
positionScreen
.
x
-
v3
.
positionScreen
.
x
)
*
(
v4
.
positionScreen
.
y
-
v3
.
positionScreen
.
y
)
-
(
v2
.
positionScreen
.
y
-
v3
.
positionScreen
.
y
)
*
(
v4
.
positionScreen
.
x
-
v3
.
positionScreen
.
x
)
<
0
)
)
)
)
{
if
(
v1
.
visible
&&
v2
.
visible
&&
v3
.
visible
&&
v4
.
visible
)
{
visible
=
(
v4
.
positionScreen
.
x
-
v1
.
positionScreen
.
x
)
*
(
v2
.
positionScreen
.
y
-
v1
.
positionScreen
.
y
)
-
(
v4
.
positionScreen
.
y
-
v1
.
positionScreen
.
y
)
*
(
v2
.
positionScreen
.
x
-
v1
.
positionScreen
.
x
)
<
0
||
(
v2
.
positionScreen
.
x
-
v3
.
positionScreen
.
x
)
*
(
v4
.
positionScreen
.
y
-
v3
.
positionScreen
.
y
)
-
(
v2
.
positionScreen
.
y
-
v3
.
positionScreen
.
y
)
*
(
v4
.
positionScreen
.
x
-
v3
.
positionScreen
.
x
)
<
0
;
if
(
object
.
doubleSided
||
visible
!=
object
.
flipSided
)
{
_face
=
getNextFace4InPool
();
_face
.
v1
.
copy
(
v1
);
_face
.
v2
.
copy
(
v2
);
_face
.
v3
.
copy
(
v3
);
_face
.
v4
.
copy
(
v4
);
}
else
{
_face
=
getNextFace4InPool
()
;
continue
;
_face
.
v1
.
copy
(
v1
);
_face
.
v2
.
copy
(
v2
);
_face
.
v3
.
copy
(
v3
);
_face
.
v4
.
copy
(
v4
);
}
}
else
{
...
...
@@ -254,6 +270,7 @@ THREE.Projector = function() {
}
_face
.
normalWorld
.
copy
(
face
.
normal
);
if
(
!
visible
&&
(
object
.
flipSided
||
object
.
doubleSided
)
)
_face
.
normalWorld
.
negate
();
objectMatrixWorldRotation
.
multiplyVector3
(
_face
.
normalWorld
);
_face
.
centroidWorld
.
copy
(
face
.
centroid
);
...
...
@@ -268,6 +285,7 @@ THREE.Projector = function() {
normal
=
_face
.
vertexNormalsWorld
[
n
];
normal
.
copy
(
faceVertexNormals
[
n
]
);
if
(
!
visible
&&
(
object
.
flipSided
||
object
.
doubleSided
)
)
normal
.
negate
();
objectMatrixWorldRotation
.
multiplyVector3
(
normal
);
}
...
...
@@ -286,7 +304,7 @@ THREE.Projector = function() {
}
_face
.
material
=
object
M
aterial
;
_face
.
material
=
object
.
m
aterial
;
_face
.
faceMaterial
=
face
.
materialIndex
!==
null
?
geometryMaterials
[
face
.
materialIndex
]
:
null
;
_face
.
z
=
_face
.
centroidScreen
.
z
;
...
...
@@ -328,7 +346,7 @@ THREE.Projector = function() {
_line
.
z
=
Math
.
max
(
_clippedVertex1PositionScreen
.
z
,
_clippedVertex2PositionScreen
.
z
);
_line
.
material
=
object
M
aterial
;
_line
.
material
=
object
.
m
aterial
;
_renderData
.
elements
.
push
(
_line
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录