Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
1936c81e
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,发现更多精彩内容 >>
提交
1936c81e
编写于
3月 11, 2014
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
3281097c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
4 addition
and
14 deletion
+4
-14
build/three.js
build/three.js
+2
-12
build/three.min.js
build/three.min.js
+2
-2
未找到文件。
build/three.js
浏览文件 @
1936c81e
...
...
@@ -33684,7 +33684,7 @@ THREE.LatheGeometry.prototype = Object.create( THREE.Geometry.prototype );
* based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as
*/
THREE.Plane
Buffer
Geometry = function ( width, height, widthSegments, heightSegments ) {
THREE.PlaneGeometry = function ( width, height, widthSegments, heightSegments ) {
THREE.BufferGeometry.call( this );
...
...
@@ -33771,17 +33771,7 @@ THREE.PlaneBufferGeometry = function ( width, height, widthSegments, heightSegme
};
THREE.PlaneBufferGeometry.prototype = Object.create( THREE.BufferGeometry.prototype );
/**
* @author mrdoob / http://mrdoob.com/
*/
THREE.PlaneGeometry = function ( width, height, widthSegments, heightSegments ) {
return new THREE.Geometry2( new THREE.PlaneBufferGeometry( width, height, widthSegments, heightSegments ) );
};
THREE.PlaneGeometry.prototype = Object.create( THREE.BufferGeometry.prototype );
/**
* @author Kaleb Murphy
...
...
build/three.min.js
浏览文件 @
1936c81e
...
...
@@ -635,8 +635,8 @@ n=a.vertices[g].y;g=a.vertices[g].z;q=a.vertices[h].x;var p=a.vertices[h].y;a=a.
THREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);!1===a instanceof Array&&(a=[a]);this.shapebb=a[a.length-1].getBoundingBox();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,f,g,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,l=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,f=l.length;e<f;e++)g=l[e],THREE.Shape.Utils.isClockWise(g)&&(l[e]=g.reverse());var n=THREE.Shape.Utils.triangulateShape(k,l);e=0;for(f=l.length;e<f;e++)g=l[e],
k=k.concat(g);l=k.length;f=n.length;for(e=0;e<l;e++)g=k[e],this.vertices.push(new THREE.Vector3(g.x,g.y,0));for(e=0;e<f;e++)l=n[e],k=l[0]+h,g=l[1]+h,l=l[2]+h,this.faces.push(new THREE.Face3(k,g,l,null,null,c)),this.faceVertexUvs[0].push(d.generateBottomUV(this,a,b,k,g,l))};THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),f=1/b,g=0,h=b;g<=h;g++)for(var k=c+g*f*d,l=Math.cos(k),n=Math.sin(k),k=0,q=a.length;k<q;k++){var p=a[k],r=new THREE.Vector3;r.x=l*p.x-n*p.y;r.y=n*p.x+l*p.y;r.z=p.z;this.vertices.push(r)}c=a.length;g=0;for(h=b;g<h;g++)for(k=0,q=a.length-1;k<q;k++){b=n=k+c*g;d=n+c;var l=n+1+c,n=n+1,p=g*f,r=k*e,u=p+f,s=r+e;this.faces.push(new THREE.Face3(b,d,n));this.faceVertexUvs[0].push([new THREE.Vector2(p,
r
),
new
THREE
.
Vector2
(
u
,
r
),
new
THREE
.
Vector2
(
p
,
s
)]);
this
.
faces
.
push
(
new
THREE
.
Face3
(
d
,
l
,
n
));
this
.
faceVertexUvs
[
0
].
push
([
new
THREE
.
Vector2
(
u
,
r
),
new
THREE
.
Vector2
(
u
,
s
),
new
THREE
.
Vector2
(
p
,
s
)])}
this
.
mergeVertices
();
this
.
computeFaceNormals
();
this
.
computeVertexNormals
()};
THREE
.
LatheGeometry
.
prototype
=
Object
.
create
(
THREE
.
Geometry
.
prototype
);
THREE
.
Plane
BufferGeometry
=
function
(
a
,
b
,
c
,
d
){
THREE
.
BufferGeometry
.
call
(
this
);
this
.
parameters
=
{
width
:
a
,
height
:
b
,
widthSegments
:
c
,
heightSegments
:
d
};
var
e
=
a
/
2
,
f
=
b
/
2
;
c
=
c
||
1
;
d
=
d
||
1
;
var
g
=
c
+
1
,
h
=
d
+
1
,
k
=
a
/
c
,
l
=
b
/
d
;
b
=
new
Float32Array
(
g
*
h
*
3
);
a
=
new
Float32Array
(
g
*
h
*
3
);
for
(
var
n
=
new
Float32Array
(
g
*
h
*
2
),
q
=
0
,
p
=
0
,
r
=
0
;
r
<
h
;
r
++
)
for
(
var
u
=
r
*
l
-
f
,
s
=
0
;
s
<
g
;
s
++
)
b
[
q
]
=
s
*
k
-
e
,
b
[
q
+
1
]
=-
u
,
a
[
q
+
2
]
=
1
,
n
[
p
]
=
s
/
c
,
n
[
p
+
1
]
=
1
-
r
/
d
,
q
+=
3
,
p
+=
2
;
q
=
0
;
e
=
new
Uint16Array
(
c
*
d
*
6
);
for
(
r
=
0
;
r
<
d
;
r
++
)
for
(
s
=
0
;
s
<
c
;
s
++
)
f
=
s
+
g
*
(
r
+
1
),
h
=
s
+
1
+
g
*
(
r
+
1
),
k
=
s
+
1
+
g
*
r
,
e
[
q
]
=
s
+
g
*
r
,
e
[
q
+
1
]
=
f
,
e
[
q
+
2
]
=
k
,
e
[
q
+
3
]
=
f
,
e
[
q
+
4
]
=
h
,
e
[
q
+
5
]
=
k
,
q
+=
6
;
this
.
attributes
.
index
=
{
array
:
e
,
itemSize
:
1
};
this
.
attributes
.
position
=
{
array
:
b
,
itemSize
:
3
};
this
.
attributes
.
normal
=
{
array
:
a
,
itemSize
:
3
};
this
.
attributes
.
uv
=
{
array
:
n
,
itemSize
:
2
}};
THREE
.
PlaneBufferGeometry
.
prototype
=
Object
.
create
(
THREE
.
BufferGeometry
.
prototype
);
THREE
.
PlaneGeometry
=
function
(
a
,
b
,
c
,
d
){
return
new
THREE
.
Geometry2
(
new
THREE
.
PlaneBufferGeometry
(
a
,
b
,
c
,
d
))}
;
THREE
.
RingGeometry
=
function
(
a
,
b
,
c
,
d
,
e
,
f
){
THREE
.
Geometry
.
call
(
this
);
a
=
a
||
0
;
b
=
b
||
50
;
e
=
void
0
!==
e
?
e
:
0
;
f
=
void
0
!==
f
?
f
:
2
*
Math
.
PI
;
c
=
void
0
!==
c
?
Math
.
max
(
3
,
c
):
8
;
d
=
void
0
!==
d
?
Math
.
max
(
3
,
d
):
8
;
var
g
,
h
=
[],
k
=
a
,
l
=
(
b
-
a
)
/
d
;
for
(
a
=
0
;
a
<=
d
;
a
++
){
for
(
g
=
0
;
g
<=
c
;
g
++
){
var
n
=
new
THREE
.
Vector3
,
q
=
e
+
g
/
c
*
f
;
n
.
x
=
k
*
Math
.
cos
(
q
);
n
.
y
=
k
*
Math
.
sin
(
q
);
this
.
vertices
.
push
(
n
);
h
.
push
(
new
THREE
.
Vector2
((
n
.
x
/
b
+
1
)
/
2
,(
n
.
y
/
b
+
1
)
/
2
))}
k
+=
l
}
b
=
new
THREE
.
Vector3
(
0
,
0
,
1
);
for
(
a
=
0
;
a
<
d
;
a
++
)
for
(
e
=
a
*
c
,
g
=
0
;
g
<=
c
;
g
++
)
q
=
g
+
e
,
f
=
q
+
a
,
l
=
q
+
c
+
a
,
n
=
q
+
c
+
1
+
a
,
this
.
faces
.
push
(
new
THREE
.
Face3
(
f
,
r),new THREE.Vector2(u,r),new THREE.Vector2(p,s)]);this.faces.push(new THREE.Face3(d,l,n));this.faceVertexUvs[0].push([new THREE.Vector2(u,r),new THREE.Vector2(u,s),new THREE.Vector2(p,s)])}this.mergeVertices();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.Plane
Geometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,f=b/2;c=c||1;d=d||1;var g=c+1,h=d+1,k=a/c,l=b/d;b=new Float32Array(g*h*3);a=new Float32Array(g*h*3);for(var n=new Float32Array(g*h*2),q=0,p=0,r=0;r<h;r++)for(var u=r*l-f,s=0;s<g;s++)b[q]=s*k-e,b[q+1]=-u,a[q+2]=1,n[p]=s/c,n[p+1]=1-r/d,q+=3,p+=2;q=0;e=new Uint16Array(c*d*6);for(r=0;r<d;r++)for(s=0;s<c;s++)f=s+g*(r+1),h=s+1+g*(r+1),k=s+1+g*r,e[q]=s+g*r,e[q
+
1]=f,e[q+2]=k,e[q+3]=f,e[q+4]=h,e[q+5]=k,q+=6;this.attributes.index={array:e,itemSize:1};this.attributes.position={array:b,itemSize:3};this.attributes.normal={array:a,itemSize:3};this.attributes.uv={array:n,itemSize:2}};THREE.PlaneGeometry.prototype=Object.create(THREE.BufferGeometry.prototype)
;THREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);a=a||0;b=b||50;e=void 0!==e?e:0;f=void 0!==f?f:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(3,d):8;var g,h=[],k=a,l=(b-a)/d;for(a=0;a<=d;a++){for(g=0;g<=c;g++){var n=new THREE.Vector3,q=e+g/c*f;n.x=k*Math.cos(q);n.y=k*Math.sin(q);this.vertices.push(n);h.push(new THREE.Vector2((n.x/b+1)/2,(n.y/b+1)/2))}k+=l}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*c,g=0;g<=c;g++)q=g+e,f=q+a,l=q+c+a,n=q+c+1+a,this.faces.push(new THREE.Face3(f,
l,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[n].clone()]),f=q+a,l=q+c+1+a,n=q+1+a,this.faces.push(new THREE.Face3(f,l,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[n].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,k)};THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.SphereGeometry=function(a,b,c,d,e,f,g){THREE.Geometry.call(this);this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||50;b=Math.max(3,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;f=void 0!==f?f:0;g=void 0!==g?g:Math.PI;var h,k,l=[],n=[];for(k=0;k<=c;k++){var q=[],p=[];for(h=0;h<=b;h++){var r=h/b,u=k/c,s=new THREE.Vector3;s.x=-a*Math.cos(d+r*e)*Math.sin(f+u*g);s.y=a*Math.cos(f+u*g);s.z=
a*Math.sin(d+r*e)*Math.sin(f+u*g);this.vertices.push(s);q.push(this.vertices.length-1);p.push(new THREE.Vector2(r,1-u))}l.push(q);n.push(p)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=l[k][h+1];e=l[k][h];f=l[k+1][h];g=l[k+1][h+1];var q=this.vertices[d].clone().normalize(),p=this.vertices[e].clone().normalize(),r=this.vertices[f].clone().normalize(),u=this.vertices[g].clone().normalize(),s=n[k][h+1].clone(),v=n[k][h].clone(),w=n[k+1][h].clone(),t=n[k+1][h+1].clone();Math.abs(this.vertices[d].y)===a?(s.x=(s.x+
v.x)/2,this.faces.push(new THREE.Face3(d,f,g,[q,r,u])),this.faceVertexUvs[0].push([s,w,t])):Math.abs(this.vertices[f].y)===a?(w.x=(w.x+t.x)/2,this.faces.push(new THREE.Face3(d,e,f,[q,p,r])),this.faceVertexUvs[0].push([s,v,w])):(this.faces.push(new THREE.Face3(d,e,g,[q,p,u])),this.faceVertexUvs[0].push([s,v,t]),this.faces.push(new THREE.Face3(e,f,g,[p.clone(),r,u.clone()])),this.faceVertexUvs[0].push([v.clone(),w,t.clone()]))}this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录