Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
054b9cee
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,发现更多精彩内容 >>
提交
054b9cee
编写于
3月 11, 2014
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
eb6ac9a2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
3 addition
and
5 deletion
+3
-5
build/three.js
build/three.js
+0
-2
build/three.min.js
build/three.min.js
+3
-3
未找到文件。
build/three.js
浏览文件 @
054b9cee
...
...
@@ -6296,8 +6296,6 @@ THREE.Plane.prototype = {
THREE.Math = {
PI2: Math.PI * 2,
generateUUID: function () {
// http://www.broofa.com/Tools/Math.uuid.htm
...
...
build/three.min.js
浏览文件 @
054b9cee
...
...
@@ -130,9 +130,9 @@ THREE.Plane.prototype={constructor:THREE.Plane,set:function(a,b){this.normal.cop
c);return this}}(),copy:function(a){this.normal.copy(a.normal);this.constant=a.constant;return this},normalize:function(){var a=1/this.normal.length();this.normal.multiplyScalar(a);this.constant*=a;return this},negate:function(){this.constant*=-1;this.normal.negate();return this},distanceToPoint:function(a){return this.normal.dot(a)+this.constant},distanceToSphere:function(a){return this.distanceToPoint(a.center)-a.radius},projectPoint:function(a,b){return this.orthoPoint(a,b).sub(a).negate()},orthoPoint:function(a,
b){var c=this.distanceToPoint(a);return(b||new THREE.Vector3).copy(this.normal).multiplyScalar(c)},isIntersectionLine:function(a){var b=this.distanceToPoint(a.start);a=this.distanceToPoint(a.end);return 0>b&&0<a||0>a&&0<b},intersectLine:function(){var a=new THREE.Vector3;return function(b,c){var d=c||new THREE.Vector3,e=b.delta(a),f=this.normal.dot(e);if(0==f){if(0==this.distanceToPoint(b.start))return d.copy(b.start)}else return f=-(b.start.dot(this.normal)+this.constant)/f,0>f||1<f?void 0:d.copy(e).multiplyScalar(f).add(b.start)}}(),
coplanarPoint:function(a){return(a||new THREE.Vector3).copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Matrix3;return function(d,e){var f=e||c.getNormalMatrix(d),f=a.copy(this.normal).applyMatrix3(f),g=this.coplanarPoint(b);g.applyMatrix4(d);this.setFromNormalAndCoplanarPoint(f,g);return this}}(),translate:function(a){this.constant-=a.dot(this.normal);return this},equals:function(a){return a.normal.equals(this.normal)&&
a
.
constant
==
this
.
constant
},
clone
:
function
(){
return
(
new
THREE
.
Plane
).
copy
(
this
)}};
THREE
.
Math
=
{
PI2
:
2
*
Math
.
PI
,
generateUUID
:
function
(){
var
a
=
"
0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
"
.
split
(
""
),
b
=
Array
(
36
),
c
=
0
,
d
;
return
function
(){
for
(
var
e
=
0
;
36
>
e
;
e
++
)
8
==
e
||
13
==
e
||
18
==
e
||
23
==
e
?
b
[
e
]
=
"
-
"
:
14
==
e
?
b
[
e
]
=
"
4
"
:(
2
>=
c
&&
(
c
=
33554432
+
16777216
*
Math
.
random
()
|
0
),
d
=
c
&
15
,
c
>>=
4
,
b
[
e
]
=
a
[
19
==
e
?
d
&
3
|
8
:
d
]);
return
b
.
join
(
""
)}}(),
clamp
:
function
(
a
,
b
,
c
){
return
a
<
b
?
b
:
a
>
c
?
c
:
a
},
clampBottom
:
function
(
a
,
b
){
return
a
<
b
?
b
:
a
},
mapLinear
:
function
(
a
,
b
,
c
,
d
,
e
){
return
d
+
(
a
-
b
)
*
(
e
-
d
)
/
(
c
-
b
)},
smoothstep
:
function
(
a
,
b
,
c
){
if
(
a
<=
b
)
return
0
;
if
(
a
>=
c
)
return
1
;
a
=
(
a
-
b
)
/
(
c
-
b
);
return
a
*
a
*
(
3
-
2
*
a
)},
smootherstep
:
function
(
a
,
b
,
c
){
if
(
a
<=
b
)
return
0
;
if
(
a
>=
c
)
return
1
;
a
=
(
a
-
b
)
/
(
c
-
b
);
return
a
*
a
*
a
*
(
a
*
(
6
*
a
-
15
)
+
10
)},
random16
:
function
(){
return
(
65280
*
Math
.
random
()
+
255
*
Math
.
random
())
/
65535
},
randInt
:
function
(
a
,
b
){
return
a
+
Math
.
floor
(
Math
.
random
()
*
(
b
-
a
+
1
))},
randFloat
:
function
(
a
,
b
){
return
a
+
Math
.
random
()
*
(
b
-
a
)},
randFloatSpread
:
function
(
a
){
return
a
*
(
0.5
-
Math
.
random
())},
sign
:
function
(
a
){
return
0
>
a
?
-
1
:
0
<
a
?
1
:
0
},
degToRad
:
function
(){
var
a
=
Math
.
PI
/
180
;
return
function
(
b
){
return
b
*
a
}}(),
radToDeg
:
function
(){
var
a
=
180
/
Math
.
PI
;
return
function
(
b
){
return
b
*
a
}}(),
isPowerOfTwo
:
function
(
a
){
return
0
===
(
a
&
a
-
1
)
&&
0
!==
a
}};
THREE
.
Spline
=
function
(
a
){
function
b
(
a
,
b
,
c
,
d
,
e
,
f
,
g
){
a
=
0.5
*
(
c
-
a
);
d
=
0.5
*
(
d
-
b
);
return
(
2
*
(
b
-
c
)
+
a
+
d
)
*
g
+
(
-
3
*
(
b
-
c
)
-
2
*
a
-
d
)
*
f
+
a
*
e
+
b
}
this
.
points
=
a
;
var
c
=
[],
d
=
{
x
:
0
,
y
:
0
,
z
:
0
},
e
,
f
,
g
,
h
,
k
,
l
,
n
,
q
,
p
;
this
.
initFromArray
=
function
(
a
){
this
.
points
=
[];
for
(
var
b
=
0
;
b
<
a
.
length
;
b
++
)
this
.
points
[
b
]
=
{
x
:
a
[
b
][
0
],
y
:
a
[
b
][
1
],
z
:
a
[
b
][
2
]}};
this
.
getPoint
=
function
(
a
){
e
=
(
this
.
points
.
length
-
1
)
*
a
;
f
=
Math
.
floor
(
e
);
g
=
e
-
f
;
c
[
0
]
=
0
===
f
?
f
:
f
-
1
;
c
[
1
]
=
f
;
c
[
2
]
=
f
>
this
.
points
.
length
-
2
?
this
.
points
.
length
-
1
:
f
+
1
;
c
[
3
]
=
f
>
this
.
points
.
length
-
3
?
this
.
points
.
length
-
1
:
a.constant==this.constant},clone:function(){return(new THREE.Plane).copy(this)}};THREE.Math={
generateUUID:function(){var a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),b=Array(36),c=0,d;return function(){for(var e=0;36>e;e++)8==e||13==e||18==e||23==e?b[e]="-":14==e?b[e]="4":(2>=c&&(c=33554432+16777216*Math.random()|0),d=c&15,c>>=4,b[e]=a[19==e?d&3|8:d]);return b.join("")}}(),clamp:function(a,b,c){return a<b?b:a>c?c:a},clampBottom:function(a,b){return a<b?b:a},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},smoothstep:function(a,b,c){if(a<=
b
)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*a*(a*(6*a-15)+10)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(0.5-Math.random())},sign:function(a){return 0>a?-1:0<a?1:0},degToRad:function(){var a=Math.PI/180;return function(b){return b*
a}}(),radToDeg:function(){var a=180/Math.PI;return function(b){return b*a}}(),isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a}};THREE.Spline=function(a){function b(a,b,c,d,e,f,g){a=0.5*(c-a);d=0.5*(d-b);return(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,f,g,h,k,l,n,q,p;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){e=(this.points.length-1)*a;f=Math.floor(e);g=e-f;c[0]=0===f?f:f-1;c[1]=f;c[2]=f>this.points.length-2?this.points.length-1:f+1;c[3]=f>this.points.length-3?this.points.length-1:
f+2;l=this.points[c[0]];n=this.points[c[1]];q=this.points[c[2]];p=this.points[c[3]];h=g*g;k=g*h;d.x=b(l.x,n.x,q.x,p.x,g,h,k);d.y=b(l.y,n.y,q.y,p.y,g,h,k);d.z=b(l.z,n.z,q.z,p.z,g,h,k);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a<c;a++)b=this.points[a],d[a]=[b.x,b.y,b.z];return d};this.getLength=function(a){var b,c,d,e=b=b=0,f=new THREE.Vector3,g=new THREE.Vector3,h=[],k=0;h[0]=0;a||(a=100);c=this.points.length*a;f.copy(this.points[0]);for(a=1;a<c;a++)b=
a/c,d=this.getPoint(b),g.copy(d),k+=g.distanceTo(f),f.copy(d),b*=this.points.length-1,b=Math.floor(b),b!=e&&(h[b]=k,e=b);h[h.length]=k;return{chunks:h,total:k}};this.reparametrizeByArcLength=function(a){var b,c,d,e,f,g,h=[],k=new THREE.Vector3,l=this.getLength();h.push(k.copy(this.points[0]).clone());for(b=1;b<this.points.length;b++){c=l.chunks[b]-l.chunks[b-1];g=Math.ceil(a*c/l.total);e=(b-1)/(this.points.length-1);f=b/(this.points.length-1);for(c=1;c<g-1;c++)d=e+1/g*c*(f-e),d=this.getPoint(d),h.push(k.copy(d).clone());
h.push(k.copy(this.points[b]).clone())}this.points=h}};THREE.Triangle=function(a,b,c){this.a=void 0!==a?a:new THREE.Vector3;this.b=void 0!==b?b:new THREE.Vector3;this.c=void 0!==c?c:new THREE.Vector3};THREE.Triangle.normal=function(){var a=new THREE.Vector3;return function(b,c,d,e){e=e||new THREE.Vector3;e.subVectors(d,c);a.subVectors(b,c);e.cross(a);b=e.lengthSq();return 0<b?e.multiplyScalar(1/Math.sqrt(b)):e.set(0,0,0)}}();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录