Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
0d95765c
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,发现更多精彩内容 >>
提交
0d95765c
编写于
10月 01, 2014
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
954e55a5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
45 deletion
+23
-45
build/three.js
build/three.js
+20
-42
build/three.min.js
build/three.min.js
+3
-3
未找到文件。
build/three.js
浏览文件 @
0d95765c
...
...
@@ -29742,19 +29742,15 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
THREE.ExtrudeGeometry.WorldUVGenerator = {
generateTopUV: function( geometry, extrudedShape, extrudeOptions, indexA, indexB, indexC ) {
var ax = geometry.vertices[ indexA ].x,
ay = geometry.vertices[ indexA ].y,
bx = geometry.vertices[ indexB ].x,
by = geometry.vertices[ indexB ].y,
cx = geometry.vertices[ indexC ].x,
cy = geometry.vertices[ indexC ].y;
var a = geometry.vertices[ indexA ];
var b = geometry.vertices[ indexB ];
var c = geometry.vertices[ indexC ];
return [
new THREE.Vector2( a
x, a
y ),
new THREE.Vector2( b
x, b
y ),
new THREE.Vector2( c
x, c
y )
new THREE.Vector2( a
.x, a.
y ),
new THREE.Vector2( b
.x, b.
y ),
new THREE.Vector2( c
.x, c.
y )
];
},
...
...
@@ -29769,47 +29765,29 @@ THREE.ExtrudeGeometry.WorldUVGenerator = {
indexA, indexB, indexC, indexD, stepIndex, stepsLength,
contourIndex1, contourIndex2 ) {
var ax = geometry.vertices[ indexA ].x,
ay = geometry.vertices[ indexA ].y,
az = geometry.vertices[ indexA ].z,
bx = geometry.vertices[ indexB ].x,
by = geometry.vertices[ indexB ].y,
bz = geometry.vertices[ indexB ].z,
var a = geometry.vertices[ indexA ];
var b = geometry.vertices[ indexB ];
var c = geometry.vertices[ indexC ];
var d = geometry.vertices[ indexD ];
cx = geometry.vertices[ indexC ].x,
cy = geometry.vertices[ indexC ].y,
cz = geometry.vertices[ indexC ].z,
dx = geometry.vertices[ indexD ].x,
dy = geometry.vertices[ indexD ].y,
dz = geometry.vertices[ indexD ].z;
if ( Math.abs( ay - by ) < 0.01 ) {
if ( Math.abs( a.y - b.y ) < 0.01 ) {
return [
new THREE.Vector2( a
x, 1 - a
z ),
new THREE.Vector2( b
x, 1 - b
z ),
new THREE.Vector2( c
x, 1 - c
z ),
new THREE.Vector2( d
x, 1 - d
z )
new THREE.Vector2( a
.x, 1 - a.
z ),
new THREE.Vector2( b
.x, 1 - b.
z ),
new THREE.Vector2( c
.x, 1 - c.
z ),
new THREE.Vector2( d
.x, 1 - d.
z )
];
} else {
return [
new THREE.Vector2( a
y, 1 - a
z ),
new THREE.Vector2( b
y, 1 - b
z ),
new THREE.Vector2( c
y, 1 - c
z ),
new THREE.Vector2( d
y, 1 - d
z )
new THREE.Vector2( a
.y, 1 - a.
z ),
new THREE.Vector2( b
.y, 1 - b.
z ),
new THREE.Vector2( c
.y, 1 - c.
z ),
new THREE.Vector2( d
.y, 1 - d.
z )
];
}
}
};
THREE.ExtrudeGeometry.__v1 = new THREE.Vector2();
THREE.ExtrudeGeometry.__v2 = new THREE.Vector2();
THREE.ExtrudeGeometry.__v3 = new THREE.Vector2();
THREE.ExtrudeGeometry.__v4 = new THREE.Vector2();
THREE.ExtrudeGeometry.__v5 = new THREE.Vector2();
THREE.ExtrudeGeometry.__v6 = new THREE.Vector2();
// File:src/extras/geometries/ShapeGeometry.js
/**
...
...
build/three.min.js
浏览文件 @
0d95765c
...
...
@@ -687,9 +687,9 @@ r.reverse();D=0;for(J=Q.length;D<J;D++)y=Q[D],THREE.Shape.Utils.isClockWise(y)&&
y[R],y[G]);ha.push(ra);Ia=Ia.concat(ra)}for(R=0;R<n;R++){N=R/n;xa=k*(1-N);G=m*Math.sin(N*Math.PI/2);L=0;for(N=V.length;L<N;L++)P=c(V[L],p[L],G),g(P.x,P.y,-xa);D=0;for(J=Q.length;D<J;D++)for(y=Q[D],ra=ha[D],L=0,N=y.length;L<N;L++)P=c(y[L],ra[L],G),g(P.x,P.y,-xa)}G=m;for(L=0;L<ya;L++)P=q?c(r[L],Ia[L],G):r[L],v?(C.copy(x.normals[0]).multiplyScalar(P.x),F.copy(x.binormals[0]).multiplyScalar(P.y),B.copy(s[0]).add(C).add(F),g(B.x,B.y,B.z)):g(P.x,P.y,0);for(N=1;N<=t;N++)for(L=0;L<ya;L++)P=q?c(r[L],Ia[L],
G):r[L],v?(C.copy(x.normals[N]).multiplyScalar(P.x),F.copy(x.binormals[N]).multiplyScalar(P.y),B.copy(s[N]).add(C).add(F),g(B.x,B.y,B.z)):g(P.x,P.y,h/t*N);for(R=n-1;0<=R;R--){N=R/n;xa=k*(1-N);G=m*Math.sin(N*Math.PI/2);L=0;for(N=V.length;L<N;L++)P=c(V[L],p[L],G),g(P.x,P.y,h+xa);D=0;for(J=Q.length;D<J;D++)for(y=Q[D],ra=ha[D],L=0,N=y.length;L<N;L++)P=c(y[L],ra[L],G),v?g(P.x,P.y+s[t-1].y,s[t-1].x+xa):g(P.x,P.y,h+xa)}(function(){if(q){var a;a=0*ya;for(L=0;L<sa;L++)la=da[L],f(la[2]+a,la[1]+a,la[0]+a,!0);
a=t+2*n;a*=ya;for(L=0;L<sa;L++)la=da[L],f(la[0]+a,la[1]+a,la[2]+a,!1)}else{for(L=0;L<sa;L++)la=da[L],f(la[2],la[1],la[0],!0);for(L=0;L<sa;L++)la=da[L],f(la[0]+ya*t,la[1]+ya*t,la[2]+ya*t,!1)}})();(function(){var a=0;e(V,a);a+=V.length;D=0;for(J=Q.length;D<J;D++)y=Q[D],e(y,a),a+=y.length})()};
THREE
.
ExtrudeGeometry
.
WorldUVGenerator
=
{
generateTopUV
:
function
(
a
,
b
,
c
,
d
,
e
,
g
){
b
=
a
.
vertices
[
e
].
x
;
e
=
a
.
vertices
[
e
].
y
;
c
=
a
.
vertices
[
g
].
x
;
g
=
a
.
vertices
[
g
].
y
;
return
[
new
THREE
.
Vector2
(
a
.
vertices
[
d
].
x
,
a
.
vertices
[
d
].
y
),
new
THREE
.
Vector2
(
b
,
e
),
new
THREE
.
Vector2
(
c
,
g
)]},
generateBottomUV
:
function
(
a
,
b
,
c
,
d
,
e
,
g
){
return
this
.
generateTopUV
(
a
,
b
,
c
,
d
,
e
,
g
)},
generateSideWallUV
:
function
(
a
,
b
,
c
,
d
,
e
,
g
,
f
,
h
,
k
,
m
,
n
,
q
){
b
=
a
.
vertices
[
e
].
x
;
c
=
a
.
vertices
[
e
].
y
;
e
=
a
.
vertices
[
e
].
z
;
d
=
a
.
vertices
[
g
].
x
;
k
=
a
.
vertices
[
g
].
y
;
g
=
a
.
vertices
[
g
].
z
;
m
=
a
.
vertices
[
f
].
x
;
n
=
a
.
vertices
[
f
].
y
;
f
=
a
.
vertices
[
f
].
z
;
q
=
a
.
vertices
[
h
].
x
;
var
r
=
a
.
vertices
[
h
].
y
;
a
=
a
.
vertices
[
h
].
z
;
return
.
01
>
Math
.
abs
(
c
-
k
)?[
new
THREE
.
Vector2
(
b
,
1
-
e
),
new
THREE
.
Vector2
(
d
,
1
-
g
),
new
THREE
.
Vector2
(
m
,
1
-
f
),
new
THREE
.
Vector2
(
q
,
1
-
a
)]:[
new
THREE
.
Vector2
(
c
,
1
-
e
),
new
THREE
.
Vector2
(
k
,
1
-
g
),
new
THREE
.
Vector2
(
n
,
1
-
f
),
new
THREE
.
Vector2
(
r
,
1
-
a
)]}};
THREE
.
ExtrudeGeometry
.
__v1
=
new
THREE
.
Vector2
;
THREE
.
ExtrudeGeometry
.
__v2
=
new
THREE
.
Vector2
;
THREE
.
ExtrudeGeometry
.
__v3
=
new
THREE
.
Vector2
;
THREE
.
ExtrudeGeometry
.
__v4
=
new
THREE
.
Vector2
;
THREE
.
ExtrudeGeometry
.
__v5
=
new
THREE
.
Vector2
;
THREE
.
ExtrudeGeometry
.
__v6
=
new
THREE
.
Vector2
;
THREE
.
ShapeGeometry
=
function
(
a
,
b
){
THREE
.
Geometry
.
call
(
this
);
this
.
type
=
"
ShapeGeometry
"
;
!
1
===
a
instanceof
Array
&&
(
a
=
[
a
]);
this
.
addShapeList
(
a
,
b
);
this
.
computeFaceNormals
()};
THREE
.
ShapeGeometry
.
prototype
=
Object
.
create
(
THREE
.
Geometry
.
prototype
);
THREE
.
ShapeGeometry
.
prototype
.
addShapeList
=
function
(
a
,
b
){
for
(
var
c
=
0
,
d
=
a
.
length
;
c
<
d
;
c
++
)
this
.
addShape
(
a
[
c
],
b
);
return
this
};
THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d,e,g){b=a.vertices[
d];e=a.vertices[e];a=a.vertices[g];return[new THREE.Vector2(b.x,b.y),new THREE.Vector2(e.x,e.y),new THREE.Vector2(a.x,a.y)]},generateBottomUV:function(a,b,c,d,e,g){return this.generateTopUV(a,b,c,d,e,g)},generateSideWallUV:function(a,b,c,d,e,g,f,h,k,m,n,q){b=a.vertices[e];g=a.vertices[g];f=a.vertices[f];a=a.vertices[h];return.01>Math.abs(b.y-g.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(g.x,1-g.z),new THREE.Vector2(f.x,
1-f.z),new THREE.Vector2(a.x,1-a.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(g.y,1-g.z),new THREE.Vector2(f.y,1-f.z),new THREE.Vector2(a.y,1-a.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===a instanceof Array&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype)
;
THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};
THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,g,f,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,m=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,g=m.length;e<g;e++)f=m[e],THREE.Shape.Utils.isClockWise(f)&&(m[e]=f.reverse());var n=THREE.Shape.Utils.triangulateShape(k,m);e=0;for(g=m.length;e<g;e++)f=m[e],
k=k.concat(f);m=k.length;g=n.length;for(e=0;e<m;e++)f=k[e],this.vertices.push(new THREE.Vector3(f.x,f.y,0));for(e=0;e<g;e++)m=n[e],k=m[0]+h,f=m[1]+h,m=m[2]+h,this.faces.push(new THREE.Face3(k,f,m,null,null,c)),this.faceVertexUvs[0].push(d.generateBottomUV(this,a,b,k,f,m))};
THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="LatheGeometry";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),g=1/b,f=0,h=b;f<=h;f++)for(var k=c+f*g*d,m=Math.cos(k),n=Math.sin(k),k=0,q=a.length;k<q;k++){var r=a[k],t=new THREE.Vector3;t.x=m*r.x-n*r.y;t.y=n*r.x+m*r.y;t.z=r.z;this.vertices.push(t)}c=a.length;f=0;for(h=b;f<h;f++)for(k=0,q=a.length-1;k<q;k++){b=n=k+c*f;d=n+c;var m=n+1+c,n=n+1,r=f*g,t=k*e,p=
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录