Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
a889bc2c
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,发现更多精彩内容 >>
提交
a889bc2c
编写于
6月 21, 2010
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
- Fixed matrix bug (transformed objects outside the x axis would get infinitely tall :S)
- Fixed overdraw when using stroke materials
上级
2a3d1e35
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
84 addition
and
71 deletion
+84
-71
README.md
README.md
+3
-1
build/three.js
build/three.js
+1
-1
src/cameras/Camera.js
src/cameras/Camera.js
+0
-1
src/core/Matrix4.js
src/core/Matrix4.js
+1
-1
src/renderers/CanvasRenderer.js
src/renderers/CanvasRenderer.js
+79
-67
未找到文件。
README.md
浏览文件 @
a889bc2c
...
...
@@ -115,11 +115,13 @@ If you are interested on messing with the actual library, instead of importing t
### Change Log ###
2010 06 20 -
**r9**
(23.
641
kb)
2010 06 20 -
**r9**
(23.
753
kb)
*
JSLinted
*
autoClear property for renderers.
*
Removed SVG rgba() workaround for WebKit. (WebKit now supports it)
*
Fixed matrix bug (transformed objects outside the x axis would get infinitely tall :S)
*
Fixed overdraw when using stroke materials
2010 06 06 -
**r8**
(23.496 kb)
...
...
build/three.js
浏览文件 @
a889bc2c
此差异已折叠。
点击以展开。
src/cameras/Camera.js
浏览文件 @
a889bc2c
...
...
@@ -11,7 +11,6 @@ THREE.Camera = function ( x, y, z ) {
this
.
projectionMatrix
=
THREE
.
Matrix4
.
makePerspective
(
45
,
1
/*SCREEN_WIDTH/SCREEN_HEIGHT*/
,
0.001
,
1000
);
this
.
up
=
new
THREE
.
Vector3
(
0
,
1
,
0
);
this
.
roll
=
0
;
// TODO: Need to remove this
this
.
zoom
=
3
;
...
...
src/core/Matrix4.js
浏览文件 @
a889bc2c
...
...
@@ -89,7 +89,7 @@ THREE.Matrix4 = function () {
this
.
n21
=
a
.
n21
*
b
.
n11
+
a
.
n22
*
b
.
n21
+
a
.
n23
*
b
.
n31
+
a
.
n24
*
b
.
n41
;
this
.
n22
=
a
.
n21
*
b
.
n12
+
a
.
n22
*
b
.
n22
+
a
.
n23
*
b
.
n32
+
a
.
n24
*
b
.
n42
;
this
.
n23
=
a
.
n21
*
b
.
n13
+
a
.
n22
*
b
.
n23
+
a
.
n23
*
b
.
n33
+
a
.
n24
*
b
.
n
34
;
this
.
n23
=
a
.
n21
*
b
.
n13
+
a
.
n22
*
b
.
n23
+
a
.
n23
*
b
.
n33
+
a
.
n24
*
b
.
n
43
;
this
.
n24
=
a
.
n21
*
b
.
n14
+
a
.
n22
*
b
.
n24
+
a
.
n23
*
b
.
n34
+
a
.
n24
*
b
.
n44
;
this
.
n31
=
a
.
n31
*
b
.
n11
+
a
.
n32
*
b
.
n21
+
a
.
n33
*
b
.
n31
+
a
.
n34
*
b
.
n41
;
...
...
src/renderers/CanvasRenderer.js
浏览文件 @
a889bc2c
...
...
@@ -46,9 +46,13 @@ THREE.CanvasRenderer = function () {
suv1
=
new
THREE
.
Vector2
(),
suv2
=
new
THREE
.
Vector2
(),
suv3
=
new
THREE
.
Vector2
(),
suv1x
,
suv1y
,
suv2x
,
suv2y
,
suv3x
,
suv3y
,
denom
,
m11
,
m12
,
m21
,
m22
,
dx
,
dy
,
bitmap
,
bitmap_width
,
bitmap_height
,
size
;
size
,
overdraw
;
this
.
autoClear
&&
this
.
clear
();
if
(
this
.
autoClear
)
{
this
.
clear
();
}
/*
_context.fillStyle = 'rgba(255, 255, 0, 0.5)';
...
...
@@ -63,106 +67,114 @@ THREE.CanvasRenderer = function () {
element
=
this
.
renderList
[
i
];
_bboxRect
.
empty
()
;
materialLength
=
element
.
material
.
length
;
_context
.
beginPath
();
for
(
j
=
0
;
j
<
materialLength
;
j
++
)
{
if
(
element
instanceof
THREE
.
RenderableParticle
)
{
material
=
element
.
material
[
j
];
size
=
element
.
size
*
element
.
screenZ
;
overdraw
=
material
instanceof
THREE
.
ColorFillMaterial
||
material
instanceof
THREE
.
FaceColorFillMaterial
||
material
instanceof
THREE
.
BitmapUVMappingMaterial
;
_bboxRect
.
set
(
element
.
x
-
size
,
element
.
y
-
size
,
element
.
x
+
size
,
element
.
y
+
size
);
_bboxRect
.
empty
(
);
if
(
!
_clipRect
.
instersects
(
_bboxRect
)
)
{
_context
.
beginPath
();
continue
;
if
(
element
instanceof
THREE
.
RenderableParticle
)
{
}
size
=
element
.
size
*
element
.
screenZ
;
_context
.
arc
(
element
.
x
,
element
.
y
,
size
,
0
,
pi2
,
tru
e
);
_bboxRect
.
set
(
element
.
x
-
size
,
element
.
y
-
size
,
element
.
x
+
size
,
element
.
y
+
siz
e
);
}
else
if
(
element
instanceof
THREE
.
RenderableLine
)
{
if
(
!
_clipRect
.
instersects
(
_bboxRect
)
)
{
v1x
=
element
.
v1
.
x
;
v1y
=
element
.
v1
.
y
;
v2x
=
element
.
v2
.
x
;
v2y
=
element
.
v2
.
y
;
continue
;
_bboxRect
.
addPoint
(
v1x
,
v1y
);
_bboxRect
.
addPoint
(
v2x
,
v2y
);
}
if
(
!
_clipRect
.
instersects
(
_bboxRect
)
)
{
_context
.
arc
(
element
.
x
,
element
.
y
,
size
,
0
,
pi2
,
true
);
continue
;
}
else
if
(
element
instanceof
THREE
.
RenderableLine
)
{
}
v1x
=
element
.
v1
.
x
;
v1y
=
element
.
v1
.
y
;
v2x
=
element
.
v2
.
x
;
v2y
=
element
.
v2
.
y
;
_context
.
moveTo
(
v1x
,
v1y
);
_context
.
lineTo
(
v2x
,
v2y
);
_bboxRect
.
addPoint
(
v1x
,
v1y
);
_bboxRect
.
addPoint
(
v2x
,
v2y
);
}
else
if
(
element
instanceof
THREE
.
RenderableFace3
)
{
if
(
!
_clipRect
.
instersects
(
_bboxRect
)
)
{
expand
(
element
.
v1
,
element
.
v2
);
expand
(
element
.
v2
,
element
.
v3
);
expand
(
element
.
v3
,
element
.
v1
);
continue
;
v1x
=
element
.
v1
.
x
;
v1y
=
element
.
v1
.
y
;
v2x
=
element
.
v2
.
x
;
v2y
=
element
.
v2
.
y
;
v3x
=
element
.
v3
.
x
;
v3y
=
element
.
v3
.
y
;
}
_bboxRect
.
addPoint
(
v1x
,
v1y
);
_bboxRect
.
addPoint
(
v2x
,
v2y
);
_bboxRect
.
addPoint
(
v3x
,
v3y
);
_context
.
moveTo
(
v1x
,
v1y
);
_context
.
lineTo
(
v2x
,
v2y
);
if
(
!
_clipRect
.
instersects
(
_bboxRect
)
)
{
}
else
if
(
element
instanceof
THREE
.
RenderableFace3
)
{
continue
;
if
(
overdraw
)
{
}
expand
(
element
.
v1
,
element
.
v2
);
expand
(
element
.
v2
,
element
.
v3
);
expand
(
element
.
v3
,
element
.
v1
);
_clearRect
.
addRectangle
(
_bboxRect
);
}
_context
.
moveTo
(
v1x
,
v1y
);
_context
.
lineTo
(
v2x
,
v2y
);
_context
.
lineTo
(
v3x
,
v3y
);
_context
.
lineTo
(
v1x
,
v1y
);
v1x
=
element
.
v1
.
x
;
v1y
=
element
.
v1
.
y
;
v2x
=
element
.
v2
.
x
;
v2y
=
element
.
v2
.
y
;
v3x
=
element
.
v3
.
x
;
v3y
=
element
.
v3
.
y
;
}
else
if
(
element
instanceof
THREE
.
RenderableFace4
)
{
_bboxRect
.
addPoint
(
v1x
,
v1y
);
_bboxRect
.
addPoint
(
v2x
,
v2y
);
_bboxRect
.
addPoint
(
v3x
,
v3y
);
expand
(
element
.
v1
,
element
.
v2
);
expand
(
element
.
v2
,
element
.
v3
);
expand
(
element
.
v3
,
element
.
v4
);
expand
(
element
.
v4
,
element
.
v1
);
if
(
!
_clipRect
.
instersects
(
_bboxRect
)
)
{
v1x
=
element
.
v1
.
x
;
v1y
=
element
.
v1
.
y
;
v2x
=
element
.
v2
.
x
;
v2y
=
element
.
v2
.
y
;
v3x
=
element
.
v3
.
x
;
v3y
=
element
.
v3
.
y
;
v4x
=
element
.
v4
.
x
;
v4y
=
element
.
v4
.
y
;
continue
;
_bboxRect
.
addPoint
(
v1x
,
v1y
);
_bboxRect
.
addPoint
(
v2x
,
v2y
);
_bboxRect
.
addPoint
(
v3x
,
v3y
);
_bboxRect
.
addPoint
(
v4x
,
v4y
);
}
if
(
!
_clipRect
.
instersects
(
_bboxRect
)
)
{
_context
.
moveTo
(
v1x
,
v1y
);
_context
.
lineTo
(
v2x
,
v2y
);
_context
.
lineTo
(
v3x
,
v3y
);
_context
.
lineTo
(
v1x
,
v1y
);
continue
;
}
else
if
(
element
instanceof
THREE
.
RenderableFace4
)
{
}
if
(
overdraw
)
{
_context
.
moveTo
(
v1x
,
v1y
);
_context
.
lineTo
(
v2x
,
v2y
);
_context
.
lineTo
(
v3x
,
v3y
);
_context
.
lineTo
(
v4x
,
v4y
);
_context
.
lineTo
(
v1x
,
v1y
);
expand
(
element
.
v1
,
element
.
v2
);
expand
(
element
.
v2
,
element
.
v3
);
expand
(
element
.
v3
,
element
.
v4
);
expand
(
element
.
v4
,
element
.
v1
);
}
}
_context
.
closePath
();
v1x
=
element
.
v1
.
x
;
v1y
=
element
.
v1
.
y
;
v2x
=
element
.
v2
.
x
;
v2y
=
element
.
v2
.
y
;
v3x
=
element
.
v3
.
x
;
v3y
=
element
.
v3
.
y
;
v4x
=
element
.
v4
.
x
;
v4y
=
element
.
v4
.
y
;
materialLength
=
element
.
material
.
length
;
_bboxRect
.
addPoint
(
v1x
,
v1y
);
_bboxRect
.
addPoint
(
v2x
,
v2y
);
_bboxRect
.
addPoint
(
v3x
,
v3y
);
_bboxRect
.
addPoint
(
v4x
,
v4y
);
for
(
j
=
0
;
j
<
materialLength
;
j
++
)
{
if
(
!
_clipRect
.
instersects
(
_bboxRect
)
)
{
material
=
element
.
material
[
j
];
continue
;
}
_context
.
moveTo
(
v1x
,
v1y
);
_context
.
lineTo
(
v2x
,
v2y
);
_context
.
lineTo
(
v3x
,
v3y
);
_context
.
lineTo
(
v4x
,
v4y
);
_context
.
lineTo
(
v1x
,
v1y
);
}
_context
.
closePath
();
if
(
material
instanceof
THREE
.
ColorFillMaterial
)
{
...
...
@@ -244,9 +256,9 @@ THREE.CanvasRenderer = function () {
}
}
_clearRect
.
addRectangle
(
_bboxRect
);
_clearRect
.
addRectangle
(
_bboxRect
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录