提交 6109c4c2 编写于 作者: M Mr.doob

Updated builds.

上级 c490e62b
......@@ -29090,7 +29090,7 @@
function subdivideFace( a, b, c, detail ) {
var cols = Math.pow( 2, detail );
var cols = detail + 1;
// we use this multidimensional array as a data structure for creating the subdivision
......@@ -244,9 +244,9 @@ materialIndex:0}]);h=0;for(k=c.length;h<k;++h)for(m=c[h],l=n=m.start,m=n+m.count
3*b+(c+1)%3),a.push(p.x,p.y,p.z);this.setAttribute("position",new ea(a,3))}function We(c,a,b){sa.call(this);this.type="ParametricGeometry";this.parameters={func:c,slices:a,stacks:b};this.fromBufferGeometry(new Td(c,a,b));this.mergeVertices()}function Td(c,a,b){ka.call(this);this.type="ParametricBufferGeometry";this.parameters={func:c,slices:a,stacks:b};var d=[],e=[],f=[],g=[],h=new w,k=new w,l=new w,m=new w,n=new w;3>c.length&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");
for(var p=a+1,t=0;t<=b;t++)for(var q=t/b,v=0;v<=a;v++){var u=v/a;c(u,q,k);e.push(k.x,k.y,k.z);0<=u-1E-5?(c(u-1E-5,q,l),m.subVectors(k,l)):(c(u+1E-5,q,l),m.subVectors(l,k));0<=q-1E-5?(c(u,q-1E-5,l),n.subVectors(k,l)):(c(u,q+1E-5,l),n.subVectors(l,k));h.crossVectors(m,n).normalize();f.push(h.x,h.y,h.z);g.push(u,q)}for(c=0;c<b;c++)for(h=0;h<a;h++)k=c*p+h+1,l=(c+1)*p+h+1,m=(c+1)*p+h,d.push(c*p+h,k,m),d.push(k,l,m);this.setIndex(d);this.setAttribute("position",new ea(e,3));this.setAttribute("normal",new ea(f,
3));this.setAttribute("uv",new ea(g,2))}function Xe(c,a,b,d){sa.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:c,indices:a,radius:b,detail:d};this.fromBufferGeometry(new zb(c,a,b,d));this.mergeVertices()}function zb(c,a,b,d){function e(l){h.push(l.x,l.y,l.z)}function f(l,m){l*=3;m.x=c[l+0];m.y=c[l+1];m.z=c[l+2]}function g(l,m,n,p){0>p&&1===l.x&&(k[m]=l.x-1);0===n.x&&0===n.z&&(k[m]=p/2/Math.PI+.5)}ka.call(this);this.type="PolyhedronBufferGeometry";this.parameters={vertices:c,indices:a,
radius:b,detail:d};b=b||1;d=d||0;var h=[],k=[];(function(l){for(var m=new w,n=new w,p=new w,t=0;t<a.length;t+=3){f(a[t+0],m);f(a[t+1],n);f(a[t+2],p);for(var q=m,v=n,u=p,A=Math.pow(2,l),B=[],D=0;D<=A;D++){B[D]=[];for(var G=q.clone().lerp(u,D/A),I=v.clone().lerp(u,D/A),E=A-D,H=0;H<=E;H++)B[D][H]=0===H&&D===A?G:G.clone().lerp(I,H/E)}for(q=0;q<A;q++)for(v=0;v<2*(A-q)-1;v++)u=Math.floor(v/2),0===v%2?(e(B[q][u+1]),e(B[q+1][u]),e(B[q][u])):(e(B[q][u+1]),e(B[q+1][u+1]),e(B[q+1][u]))}})(d);(function(l){for(var m=
new w,n=0;n<h.length;n+=3)m.x=h[n+0],m.y=h[n+1],m.z=h[n+2],m.normalize().multiplyScalar(l),h[n+0]=m.x,h[n+1]=m.y,h[n+2]=m.z})(b);(function(){for(var l=new w,m=0;m<h.length;m+=3)l.x=h[m+0],l.y=h[m+1],l.z=h[m+2],k.push(Math.atan2(l.z,-l.x)/2/Math.PI+.5,1-(Math.atan2(-l.y,Math.sqrt(l.x*l.x+l.z*l.z))/Math.PI+.5));l=new w;m=new w;for(var n=new w,p=new w,t=new L,q=new L,v=new L,u=0,A=0;u<h.length;u+=9,A+=6){l.set(h[u+0],h[u+1],h[u+2]);m.set(h[u+3],h[u+4],h[u+5]);n.set(h[u+6],h[u+7],h[u+8]);t.set(k[A+0],
k[A+1]);q.set(k[A+2],k[A+3]);v.set(k[A+4],k[A+5]);p.copy(l).add(m).add(n).divideScalar(3);var B=Math.atan2(p.z,-p.x);g(t,A+0,l,B);g(q,A+2,m,B);g(v,A+4,n,B)}for(l=0;l<k.length;l+=6)m=k[l+0],n=k[l+2],p=k[l+4],t=Math.min(m,n,p),.9<Math.max(m,n,p)&&.1>t&&(.2>m&&(k[l+0]+=1),.2>n&&(k[l+2]+=1),.2>p&&(k[l+4]+=1))})();this.setAttribute("position",new ea(h,3));this.setAttribute("normal",new ea(h.slice(),3));this.setAttribute("uv",new ea(k,2));0===d?this.computeVertexNormals():this.normalizeNormals()}function Ye(c,
radius:b,detail:d};b=b||1;d=d||0;var h=[],k=[];(function(l){for(var m=new w,n=new w,p=new w,t=0;t<a.length;t+=3){f(a[t+0],m);f(a[t+1],n);f(a[t+2],p);for(var q=m,v=n,u=p,A=l+1,B=[],D=0;D<=A;D++){B[D]=[];for(var G=q.clone().lerp(u,D/A),I=v.clone().lerp(u,D/A),E=A-D,H=0;H<=E;H++)B[D][H]=0===H&&D===A?G:G.clone().lerp(I,H/E)}for(q=0;q<A;q++)for(v=0;v<2*(A-q)-1;v++)u=Math.floor(v/2),0===v%2?(e(B[q][u+1]),e(B[q+1][u]),e(B[q][u])):(e(B[q][u+1]),e(B[q+1][u+1]),e(B[q+1][u]))}})(d);(function(l){for(var m=new w,
n=0;n<h.length;n+=3)m.x=h[n+0],m.y=h[n+1],m.z=h[n+2],m.normalize().multiplyScalar(l),h[n+0]=m.x,h[n+1]=m.y,h[n+2]=m.z})(b);(function(){for(var l=new w,m=0;m<h.length;m+=3)l.x=h[m+0],l.y=h[m+1],l.z=h[m+2],k.push(Math.atan2(l.z,-l.x)/2/Math.PI+.5,1-(Math.atan2(-l.y,Math.sqrt(l.x*l.x+l.z*l.z))/Math.PI+.5));l=new w;m=new w;for(var n=new w,p=new w,t=new L,q=new L,v=new L,u=0,A=0;u<h.length;u+=9,A+=6){l.set(h[u+0],h[u+1],h[u+2]);m.set(h[u+3],h[u+4],h[u+5]);n.set(h[u+6],h[u+7],h[u+8]);t.set(k[A+0],k[A+1]);
q.set(k[A+2],k[A+3]);v.set(k[A+4],k[A+5]);p.copy(l).add(m).add(n).divideScalar(3);var B=Math.atan2(p.z,-p.x);g(t,A+0,l,B);g(q,A+2,m,B);g(v,A+4,n,B)}for(l=0;l<k.length;l+=6)m=k[l+0],n=k[l+2],p=k[l+4],t=Math.min(m,n,p),.9<Math.max(m,n,p)&&.1>t&&(.2>m&&(k[l+0]+=1),.2>n&&(k[l+2]+=1),.2>p&&(k[l+4]+=1))})();this.setAttribute("position",new ea(h,3));this.setAttribute("normal",new ea(h.slice(),3));this.setAttribute("uv",new ea(k,2));0===d?this.computeVertexNormals():this.normalizeNormals()}function Ye(c,
a){sa.call(this);this.type="TetrahedronGeometry";this.parameters={radius:c,detail:a};this.fromBufferGeometry(new Ud(c,a));this.mergeVertices()}function Ud(c,a){zb.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],c,a);this.type="TetrahedronBufferGeometry";this.parameters={radius:c,detail:a}}function Ze(c,a){sa.call(this);this.type="OctahedronGeometry";this.parameters={radius:c,detail:a};this.fromBufferGeometry(new gd(c,a));this.mergeVertices()}function gd(c,a){zb.call(this,[1,0,
0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],c,a);this.type="OctahedronBufferGeometry";this.parameters={radius:c,detail:a}}function $e(c,a){sa.call(this);this.type="IcosahedronGeometry";this.parameters={radius:c,detail:a};this.fromBufferGeometry(new Vd(c,a));this.mergeVertices()}function Vd(c,a){var b=(1+Math.sqrt(5))/2;zb.call(this,[-1,b,0,1,b,0,-1,-b,0,1,-b,0,0,-1,b,0,1,b,0,-1,-b,0,1,-b,b,0,-1,b,0,1,-b,0,-1,-b,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,
9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],c,a);this.type="IcosahedronBufferGeometry";this.parameters={radius:c,detail:a}}function af(c,a){sa.call(this);this.type="DodecahedronGeometry";this.parameters={radius:c,detail:a};this.fromBufferGeometry(new Wd(c,a));this.mergeVertices()}function Wd(c,a){var b=(1+Math.sqrt(5))/2,d=1/b;zb.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-d,-b,0,-d,b,0,d,-b,0,d,b,-d,-b,0,-d,b,0,d,-b,0,
......
......@@ -29162,7 +29162,7 @@ class PolyhedronBufferGeometry extends BufferGeometry {
function subdivideFace( a, b, c, detail ) {
const cols = Math.pow( 2, detail );
const cols = detail + 1;
// we use this multidimensional array as a data structure for creating the subdivision
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册