Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
26b57b81
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,发现更多精彩内容 >>
提交
26b57b81
编写于
12月 10, 2012
作者:
B
Ben Houston
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Matrix4.makeTranslation and Matrix4.makeScale now take Vector3 instead of thee scalars per #2780
上级
79e173ed
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
36 addition
and
25 deletion
+36
-25
examples/css3d_molecules.html
examples/css3d_molecules.html
+1
-1
examples/webgl_geometry_minecraft.html
examples/webgl_geometry_minecraft.html
+10
-5
examples/webgl_geometry_minecraft_ao.html
examples/webgl_geometry_minecraft_ao.html
+10
-5
examples/webgl_geometry_subdivision.html
examples/webgl_geometry_subdivision.html
+1
-1
src/extras/GeometryUtils.js
src/extras/GeometryUtils.js
+1
-1
src/math/Matrix4.js
src/math/Matrix4.js
+9
-9
test/math/Box3.js
test/math/Box3.js
+1
-1
test/math/Plane.js
test/math/Plane.js
+1
-1
test/math/Sphere.js
test/math/Sphere.js
+1
-1
utils/build_all.bat
utils/build_all.bat
+1
-0
未找到文件。
examples/css3d_molecules.html
浏览文件 @
26b57b81
...
...
@@ -361,7 +361,7 @@
loader
.
load
(
url
,
function
(
geometry
,
geometryBonds
)
{
var
offset
=
THREE
.
GeometryUtils
.
center
(
geometry
);
geometryBonds
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
offset
.
x
,
offset
.
y
,
offset
.
z
)
);
geometryBonds
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
offset
)
);
for
(
var
i
=
0
;
i
<
geometry
.
vertices
.
length
;
i
++
)
{
...
...
examples/webgl_geometry_minecraft.html
浏览文件 @
26b57b81
...
...
@@ -93,26 +93,31 @@
var
pxGeometry
=
new
THREE
.
PlaneGeometry
(
100
,
100
);
pxGeometry
.
faces
[
0
].
materialIndex
=
1
;
pxGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeRotationY
(
Math
.
PI
/
2
)
);
pxGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
50
,
0
,
0
)
);
pxGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
new
THREE
.
Vector3
(
50
,
0
,
0
)
)
);
var
nxGeometry
=
new
THREE
.
PlaneGeometry
(
100
,
100
);
nxGeometry
.
faces
[
0
].
materialIndex
=
1
;
nxGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeRotationY
(
-
Math
.
PI
/
2
)
);
nxGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
-
50
,
0
,
0
)
);
nxGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
new
THREE
.
Vector3
(
-
50
,
0
,
0
)
)
);
var
pyGeometry
=
new
THREE
.
PlaneGeometry
(
100
,
100
);
pyGeometry
.
faces
[
0
].
materialIndex
=
0
;
pyGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeRotationX
(
-
Math
.
PI
/
2
)
);
pyGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
0
,
50
,
0
)
);
pyGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
new
THREE
.
Vector3
(
0
,
50
,
0
)
)
);
var
pzGeometry
=
new
THREE
.
PlaneGeometry
(
100
,
100
);
pzGeometry
.
faces
[
0
].
materialIndex
=
1
;
pzGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
0
,
0
,
50
)
);
pzGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
new
THREE
.
Vector3
(
0
,
0
,
50
)
)
);
var
nzGeometry
=
new
THREE
.
PlaneGeometry
(
100
,
100
);
nzGeometry
.
faces
[
0
].
materialIndex
=
1
;
nzGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeRotationY
(
Math
.
PI
)
);
nzGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
0
,
0
,
-
50
)
);
nzGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
new
THREE
.
Vector3
(
0
,
0
,
-
50
)
)
);
//
...
...
examples/webgl_geometry_minecraft_ao.html
浏览文件 @
26b57b81
...
...
@@ -104,30 +104,35 @@
pxGeometry
.
faces
[
0
].
materialIndex
=
1
;
pxGeometry
.
faces
[
0
].
vertexColors
=
[
light
,
shadow
,
shadow
,
light
];
pxGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeRotationY
(
Math
.
PI
/
2
)
);
pxGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
50
,
0
,
0
)
);
pxGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
new
THREE
.
Vector3
(
50
,
0
,
0
)
)
);
var
nxGeometry
=
new
THREE
.
PlaneGeometry
(
100
,
100
);
nxGeometry
.
faces
[
0
].
materialIndex
=
1
;
nxGeometry
.
faces
[
0
].
vertexColors
=
[
light
,
shadow
,
shadow
,
light
];
nxGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeRotationY
(
-
Math
.
PI
/
2
)
);
nxGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
-
50
,
0
,
0
)
);
nxGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
new
THREE
.
Vector3
(
-
50
,
0
,
0
)
)
);
var
pyGeometry
=
new
THREE
.
PlaneGeometry
(
100
,
100
);
pyGeometry
.
faces
[
0
].
materialIndex
=
0
;
pyGeometry
.
faces
[
0
].
vertexColors
=
[
light
,
light
,
light
,
light
];
pyGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeRotationX
(
-
Math
.
PI
/
2
)
);
pyGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
0
,
50
,
0
)
);
pyGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
new
THREE
.
Vector3
(
0
,
50
,
0
)
)
);
var
pzGeometry
=
new
THREE
.
PlaneGeometry
(
100
,
100
);
pzGeometry
.
faces
[
0
].
materialIndex
=
1
;
pzGeometry
.
faces
[
0
].
vertexColors
=
[
light
,
shadow
,
shadow
,
light
];
pzGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
0
,
0
,
50
)
);
pzGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
new
THREE
.
Vector3
(
0
,
0
,
50
)
)
);
var
nzGeometry
=
new
THREE
.
PlaneGeometry
(
100
,
100
);
nzGeometry
.
faces
[
0
].
materialIndex
=
1
;
nzGeometry
.
faces
[
0
].
vertexColors
=
[
light
,
shadow
,
shadow
,
light
];
nzGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeRotationY
(
Math
.
PI
)
);
nzGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
0
,
0
,
-
50
)
);
nzGeometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
new
THREE
.
Vector3
(
0
,
0
,
-
50
)
)
);
//
...
...
examples/webgl_geometry_subdivision.html
浏览文件 @
26b57b81
...
...
@@ -212,7 +212,7 @@
if
(
params
.
scale
)
{
geometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeScale
(
params
.
scale
,
params
.
scale
,
params
.
scale
)
);
geometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeScale
(
new
THREE
.
Vector3
(
params
.
scale
,
params
.
scale
,
params
.
scale
)
)
);
}
...
...
src/extras/GeometryUtils.js
浏览文件 @
26b57b81
...
...
@@ -383,7 +383,7 @@ THREE.GeometryUtils = {
offset
.
add
(
bb
.
min
,
bb
.
max
);
offset
.
multiplyScalar
(
-
0.5
);
geometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
offset
.
x
,
offset
.
y
,
offset
.
z
)
);
geometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
offset
)
);
geometry
.
computeBoundingBox
();
return
offset
;
...
...
src/math/Matrix4.js
浏览文件 @
26b57b81
...
...
@@ -587,7 +587,7 @@ THREE.Matrix4.prototype = {
mRotation
.
identity
();
mRotation
.
setRotationFromQuaternion
(
rotation
);
mScale
.
makeScale
(
scale
.
x
,
scale
.
y
,
scale
.
z
);
mScale
.
makeScale
(
scale
);
this
.
multiply
(
mRotation
,
mScale
);
...
...
@@ -888,13 +888,13 @@ THREE.Matrix4.prototype = {
//
makeTranslation
:
function
(
x
,
y
,
z
)
{
makeTranslation
:
function
(
offset
)
{
this
.
set
(
1
,
0
,
0
,
x
,
0
,
1
,
0
,
y
,
0
,
0
,
1
,
z
,
1
,
0
,
0
,
offset
.
x
,
0
,
1
,
0
,
offset
.
y
,
0
,
0
,
1
,
offset
.
z
,
0
,
0
,
0
,
1
);
...
...
@@ -977,13 +977,13 @@ THREE.Matrix4.prototype = {
},
makeScale
:
function
(
x
,
y
,
z
)
{
makeScale
:
function
(
factor
)
{
this
.
set
(
x
,
0
,
0
,
0
,
0
,
y
,
0
,
0
,
0
,
0
,
z
,
0
,
factor
.
x
,
0
,
0
,
0
,
0
,
factor
.
y
,
0
,
0
,
0
,
0
,
factor
.
z
,
0
,
0
,
0
,
0
,
1
);
...
...
test/math/Box3.js
浏览文件 @
26b57b81
...
...
@@ -247,7 +247,7 @@ test( "transform", function() {
var
m
=
new
THREE
.
Matrix4
();
var
t1
=
new
THREE
.
Vector3
(
1
,
-
2
,
1
);
m
.
makeTranslation
(
t1
.
x
,
t1
.
y
,
t1
.
z
);
m
.
makeTranslation
(
t1
);
ok
(
compareBox
(
a
.
clone
().
transform
(
m
),
a
.
clone
().
translate
(
t1
)
),
"
Passed!
"
);
ok
(
compareBox
(
b
.
clone
().
transform
(
m
),
b
.
clone
().
translate
(
t1
)
),
"
Passed!
"
);
ok
(
compareBox
(
c
.
clone
().
transform
(
m
),
c
.
clone
().
translate
(
t1
)
),
"
Passed!
"
);
...
...
test/math/Plane.js
浏览文件 @
26b57b81
...
...
@@ -159,6 +159,6 @@ test( "transform/translate", function() {
a
=
new
THREE
.
Plane
(
new
THREE
.
Vector3
(
0
,
1
,
0
),
-
1
);
ok
(
comparePlane
(
a
.
clone
().
transform
(
m
),
new
THREE
.
Plane
(
new
THREE
.
Vector3
(
-
1
,
0
,
0
),
-
1
)
),
"
Passed!
"
);
m
.
makeTranslation
(
1
,
1
,
1
);
m
.
makeTranslation
(
new
THREE
.
Vector3
(
1
,
1
,
1
)
);
ok
(
comparePlane
(
a
.
clone
().
transform
(
m
),
a
.
clone
().
translate
(
new
THREE
.
Vector3
(
1
,
1
,
1
)
)
),
"
Passed!
"
);
});
\ No newline at end of file
test/math/Sphere.js
浏览文件 @
26b57b81
...
...
@@ -81,7 +81,7 @@ test( "transform", function() {
var
m
=
new
THREE
.
Matrix4
();
var
t1
=
new
THREE
.
Vector3
(
1
,
-
2
,
1
);
m
.
makeTranslation
(
t1
.
x
,
t1
.
y
,
t1
.
z
);
m
.
makeTranslation
(
t1
);
ok
(
a
.
clone
().
transform
(
m
).
bounds
().
equals
(
a
.
bounds
().
transform
(
m
)
),
"
Passed!
"
);
});
...
...
utils/build_all.bat
浏览文件 @
26b57b81
...
...
@@ -4,4 +4,5 @@ python build.py --include canvas --minify --output ../build/three-canvas.min.js
python
build
.py
--include
css3d
--minify --output
../build/three
-css
3
d
.min.js
python
build
.py
--include
webgl
--minify --output
../build/three
-webgl
.min.js
python
build
.py
--include
extras
--externs
externs
/extras
.js
--minify --output
../build/three
-extras
.min.js
python
build
.py
--include
math
--output
../build/three
-math
.js
python
build
.py
--include
math
--minify --output
../build/three
-math
.min.js
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录