Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
f1d6fc3a
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,发现更多精彩内容 >>
提交
f1d6fc3a
编写于
2月 15, 2013
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
4d863041
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
129 addition
and
2 deletion
+129
-2
README.md
README.md
+1
-1
build/three.js
build/three.js
+124
-0
build/three.min.js
build/three.min.js
+4
-1
未找到文件。
README.md
浏览文件 @
f1d6fc3a
...
...
@@ -65,7 +65,7 @@ This code creates a scene, then creates a camera, adds the camera and cube to th
### Change log ###
2013 02 15 -
**r56**
(40
7,609 KB, gzip: 96,870
KB)
2013 02 15 -
**r56**
(40
8,927 KB, gzip: 97,095
KB)
*
Added
`LineDashedMaterial`
support to
`CanvasRenderer`
. (
[
sole
](
http://github.com/sole
)
)
*
Documentation improvements. (
[
gero3
](
http://github.com/gero3
)
,
[
erich666
](
http://github.com/erich666
)
,
[
Stompfrog
](
http://github.com/Stompfrog
)
,
[
morenoh149
](
http://github.com/morenoh149
)
,
[
chrmoritz
](
http://github.com/chrmoritz
)
and
[
mrdoob
](
http://github.com/mrdoob
)
)
...
...
build/three.js
浏览文件 @
f1d6fc3a
...
...
@@ -2656,6 +2656,130 @@ THREE.extend( THREE.Vector4.prototype, {
* @author bhouston / http://exocortex.com
*/
THREE.Line3 = function ( start, end ) {
this.start = ( start !== undefined ) ? start : new THREE.Vector3();
this.end = ( end !== undefined ) ? end : new THREE.Vector3();
};
THREE.extend( THREE.Line3.prototype, {
set: function ( start, end ) {
this.start.copy( start );
this.end.copy( end );
return this;
},
copy: function ( line ) {
this.start.copy( line.start );
this.end.copy( line.end );
return this;
},
center: function ( optionalTarget ) {
var result = optionalTarget || new THREE.Vector3();
return result.addVectors( this.start, this.end ).multiplyScalar( 0.5 );
},
delta: function ( optionalTarget ) {
var result = optionalTarget || new THREE.Vector3();
return result.subVectors( this.end, this.start );
},
distanceSq: function () {
return this.start.distanceToSquared( this.end );
},
distance: function () {
return this.start.distanceTo( this.end );
},
at: function ( t, optionalTarget ) {
var result = optionalTarget || new THREE.Vector3();
return this.delta( result ).multiplyScalar( t ).add( this.start );
},
closestPointToPointParameter: function() {
var startP = new THREE.Vector3();
var startEnd = new THREE.Vector3();
return function ( point, clampToLine ) {
startP.subVectors( point, this.start );
startEnd.subVectors( this.end, this.start );
var startEnd2 = startEnd.dot( startEnd );
var startEnd_startP = startEnd.dot( startP );
var t = startEnd_startP / startEnd2;
if( clampToLine ) {
t = THREE.Math.clamp( t, 0, 1 );
}
return t;
};
}(),
closestPointToPoint: function ( point, clampToLine, optionalTarget ) {
var t = this.closestPointToPointParameter( point, clampToLine );
var result = optionalTarget || new THREE.Vector3();
return this.delta( result ).multiplyScalar( t ).add( this.start );
},
applyMatrix4: function ( matrix ) {
this.start.applyMatrix4( matrix );
this.end.applyMatrix4( matrix );
return this;
},
equals: function ( line ) {
return line.start.equals( this.start ) && line.end.equals( this.end );
},
clone: function () {
return new THREE.Line3().copy( this );
}
} );
/**
* @author bhouston / http://exocortex.com
*/
THREE.Box2 = function ( min, max ) {
this.min = ( min !== undefined ) ? min : new THREE.Vector2( Infinity, Infinity );
...
...
build/three.min.js
浏览文件 @
f1d6fc3a
...
...
@@ -55,7 +55,10 @@ setAxisAngleFromRotationMatrix:function(a){var b,c,d,a=a.elements,e=a[0];d=a[4];
b
=
d
/
c
,
d
=
i
/
c
):
0.01
>
k
?(
c
=
b
=
0.707106781
,
d
=
0
):(
d
=
Math
.
sqrt
(
k
),
b
=
f
/
d
,
c
=
i
/
d
);
this
.
set
(
b
,
c
,
d
,
a
);
return
this
}
a
=
Math
.
sqrt
((
b
-
i
)
*
(
b
-
i
)
+
(
f
-
c
)
*
(
f
-
c
)
+
(
g
-
d
)
*
(
g
-
d
));
0.001
>
Math
.
abs
(
a
)
&&
(
a
=
1
);
this
.
x
=
(
b
-
i
)
/
a
;
this
.
y
=
(
f
-
c
)
/
a
;
this
.
z
=
(
g
-
d
)
/
a
;
this
.
w
=
Math
.
acos
((
e
+
h
+
k
-
1
)
/
2
);
return
this
},
min
:
function
(
a
){
this
.
x
>
a
.
x
&&
(
this
.
x
=
a
.
x
);
this
.
y
>
a
.
y
&&
(
this
.
y
=
a
.
y
);
this
.
z
>
a
.
z
&&
(
this
.
z
=
a
.
z
);
this
.
w
>
a
.
w
&&
(
this
.
w
=
a
.
w
);
return
this
},
max
:
function
(
a
){
this
.
x
<
a
.
x
&&
(
this
.
x
=
a
.
x
);
this
.
y
<
a
.
y
&&
(
this
.
y
=
a
.
y
);
this
.
z
<
a
.
z
&&
(
this
.
z
=
a
.
z
);
this
.
w
<
a
.
w
&&
(
this
.
w
=
a
.
w
);
return
this
},
clamp
:
function
(
a
,
b
){
this
.
x
<
a
.
x
?
this
.
x
=
a
.
x
:
this
.
x
>
b
.
x
&&
(
this
.
x
=
b
.
x
);
this
.
y
<
a
.
y
?
this
.
y
=
a
.
y
:
this
.
y
>
b
.
y
&&
(
this
.
y
=
b
.
y
);
this
.
z
<
a
.
z
?
this
.
z
=
a
.
z
:
this
.
z
>
b
.
z
&&
(
this
.
z
=
b
.
z
);
this
.
w
<
a
.
w
?
this
.
w
=
a
.
w
:
this
.
w
>
b
.
w
&&
(
this
.
w
=
b
.
w
);
return
this
},
negate
:
function
(){
return
this
.
multiplyScalar
(
-
1
)},
dot
:
function
(
a
){
return
this
.
x
*
a
.
x
+
this
.
y
*
a
.
y
+
this
.
z
*
a
.
z
+
this
.
w
*
a
.
w
},
lengthSq
:
function
(){
return
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
},
length
:
function
(){
return
Math
.
sqrt
(
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
)},
lengthManhattan
:
function
(){
return
Math
.
abs
(
this
.
x
)
+
Math
.
abs
(
this
.
y
)
+
Math
.
abs
(
this
.
z
)
+
Math
.
abs
(
this
.
w
)},
normalize
:
function
(){
return
this
.
divideScalar
(
this
.
length
())},
setLength
:
function
(
a
){
var
b
=
this
.
length
();
0
!==
b
&&
a
!==
b
&&
this
.
multiplyScalar
(
a
/
b
);
return
this
},
lerp
:
function
(
a
,
b
){
this
.
x
+=
(
a
.
x
-
this
.
x
)
*
b
;
this
.
y
+=
(
a
.
y
-
this
.
y
)
*
b
;
this
.
z
+=
(
a
.
z
-
this
.
z
)
*
b
;
this
.
w
+=
(
a
.
w
-
this
.
w
)
*
b
;
return
this
},
equals
:
function
(
a
){
return
a
.
x
===
this
.
x
&&
a
.
y
===
this
.
y
&&
a
.
z
===
this
.
z
&&
a
.
w
===
this
.
w
},
toArray
:
function
(){
return
[
this
.
x
,
this
.
y
,
this
.
z
,
this
.
w
]},
clone
:
function
(){
return
new
THREE
.
Vector4
(
this
.
x
,
this
.
y
,
this
.
z
,
this
.
w
)}});
THREE
.
Box2
=
function
(
a
,
b
){
this
.
min
=
void
0
!==
a
?
a
:
new
THREE
.
Vector2
(
Infinity
,
Infinity
);
this
.
max
=
void
0
!==
b
?
b
:
new
THREE
.
Vector2
(
-
Infinity
,
-
Infinity
)};
this
.
y
,
this
.
z
,
this
.
w
]},
clone
:
function
(){
return
new
THREE
.
Vector4
(
this
.
x
,
this
.
y
,
this
.
z
,
this
.
w
)}});
THREE
.
Line3
=
function
(
a
,
b
){
this
.
start
=
void
0
!==
a
?
a
:
new
THREE
.
Vector3
;
this
.
end
=
void
0
!==
b
?
b
:
new
THREE
.
Vector3
};
THREE
.
extend
(
THREE
.
Line3
.
prototype
,{
set
:
function
(
a
,
b
){
this
.
start
.
copy
(
a
);
this
.
end
.
copy
(
b
);
return
this
},
copy
:
function
(
a
){
this
.
start
.
copy
(
a
.
start
);
this
.
end
.
copy
(
a
.
end
);
return
this
},
center
:
function
(
a
){
return
(
a
||
new
THREE
.
Vector3
).
addVectors
(
this
.
start
,
this
.
end
).
multiplyScalar
(
0.5
)},
delta
:
function
(
a
){
return
(
a
||
new
THREE
.
Vector3
).
subVectors
(
this
.
end
,
this
.
start
)},
distanceSq
:
function
(){
return
this
.
start
.
distanceToSquared
(
this
.
end
)},
distance
:
function
(){
return
this
.
start
.
distanceTo
(
this
.
end
)},
at
:
function
(
a
,
b
){
var
c
=
b
||
new
THREE
.
Vector3
;
return
this
.
delta
(
c
).
multiplyScalar
(
a
).
add
(
this
.
start
)},
closestPointToPointParameter
:
function
(){
var
a
=
new
THREE
.
Vector3
,
b
=
new
THREE
.
Vector3
;
return
function
(
c
,
d
){
a
.
subVectors
(
c
,
this
.
start
);
b
.
subVectors
(
this
.
end
,
this
.
start
);
var
e
=
b
.
dot
(
b
),
e
=
b
.
dot
(
a
)
/
e
;
d
&&
(
e
=
THREE
.
Math
.
clamp
(
e
,
0
,
1
));
return
e
}}(),
closestPointToPoint
:
function
(
a
,
b
,
c
){
a
=
this
.
closestPointToPointParameter
(
a
,
b
);
c
=
c
||
new
THREE
.
Vector3
;
return
this
.
delta
(
c
).
multiplyScalar
(
a
).
add
(
this
.
start
)},
applyMatrix4
:
function
(
a
){
this
.
start
.
applyMatrix4
(
a
);
this
.
end
.
applyMatrix4
(
a
);
return
this
},
equals
:
function
(
a
){
return
a
.
start
.
equals
(
this
.
start
)
&&
a
.
end
.
equals
(
this
.
end
)},
clone
:
function
(){
return
(
new
THREE
.
Line3
).
copy
(
this
)}});
THREE
.
Box2
=
function
(
a
,
b
){
this
.
min
=
void
0
!==
a
?
a
:
new
THREE
.
Vector2
(
Infinity
,
Infinity
);
this
.
max
=
void
0
!==
b
?
b
:
new
THREE
.
Vector2
(
-
Infinity
,
-
Infinity
)};
THREE
.
extend
(
THREE
.
Box2
.
prototype
,{
set
:
function
(
a
,
b
){
this
.
min
.
copy
(
a
);
this
.
max
.
copy
(
b
);
return
this
},
setFromPoints
:
function
(
a
){
if
(
0
<
a
.
length
){
var
b
=
a
[
0
];
this
.
min
.
copy
(
b
);
this
.
max
.
copy
(
b
);
for
(
var
c
=
1
,
d
=
a
.
length
;
c
<
d
;
c
++
)
b
=
a
[
c
],
b
.
x
<
this
.
min
.
x
?
this
.
min
.
x
=
b
.
x
:
b
.
x
>
this
.
max
.
x
&&
(
this
.
max
.
x
=
b
.
x
),
b
.
y
<
this
.
min
.
y
?
this
.
min
.
y
=
b
.
y
:
b
.
y
>
this
.
max
.
y
&&
(
this
.
max
.
y
=
b
.
y
)}
else
this
.
makeEmpty
();
return
this
},
setFromCenterAndSize
:
function
(){
var
a
=
new
THREE
.
Vector2
;
return
function
(
b
,
c
){
var
d
=
a
.
copy
(
c
).
multiplyScalar
(
0.5
);
this
.
min
.
copy
(
b
).
sub
(
d
);
this
.
max
.
copy
(
b
).
add
(
d
);
return
this
}}(),
copy
:
function
(
a
){
this
.
min
.
copy
(
a
.
min
);
this
.
max
.
copy
(
a
.
max
);
return
this
},
makeEmpty
:
function
(){
this
.
min
.
x
=
this
.
min
.
y
=
Infinity
;
this
.
max
.
x
=
this
.
max
.
y
=-
Infinity
;
return
this
},
empty
:
function
(){
return
this
.
max
.
x
<
this
.
min
.
x
||
this
.
max
.
y
<
this
.
min
.
y
},
center
:
function
(
a
){
return
(
a
||
new
THREE
.
Vector2
).
addVectors
(
this
.
min
,
this
.
max
).
multiplyScalar
(
0.5
)},
size
:
function
(
a
){
return
(
a
||
new
THREE
.
Vector2
).
subVectors
(
this
.
max
,
this
.
min
)},
expandByPoint
:
function
(
a
){
this
.
min
.
min
(
a
);
this
.
max
.
max
(
a
);
return
this
},
expandByVector
:
function
(
a
){
this
.
min
.
sub
(
a
);
this
.
max
.
add
(
a
);
return
this
},
expandByScalar
:
function
(
a
){
this
.
min
.
addScalar
(
-
a
);
this
.
max
.
addScalar
(
a
);
return
this
},
containsPoint
:
function
(
a
){
return
a
.
x
<
this
.
min
.
x
||
a
.
x
>
this
.
max
.
x
||
a
.
y
<
this
.
min
.
y
||
a
.
y
>
this
.
max
.
y
?
!
1
:
!
0
},
containsBox
:
function
(
a
){
return
this
.
min
.
x
<=
a
.
min
.
x
&&
a
.
max
.
x
<=
this
.
max
.
x
&&
this
.
min
.
y
<=
a
.
min
.
y
&&
a
.
max
.
y
<=
this
.
max
.
y
?
!
0
:
!
1
},
getParameter
:
function
(
a
){
return
new
THREE
.
Vector2
((
a
.
x
-
this
.
min
.
x
)
/
(
this
.
max
.
x
-
this
.
min
.
x
),(
a
.
y
-
this
.
min
.
y
)
/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录