提交 9bec22d5 编写于 作者: M Mr.doob

Updated build.

上级 2a826b2e
......@@ -691,7 +691,7 @@ THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d,f,e){b=a.
g=a.vertices[g].z,n=a.vertices[h].x,m=a.vertices[h].y,a=a.vertices[h].z;return Math.abs(c-i)<0.01?[new THREE.UV(b,1-f),new THREE.UV(d,1-e),new THREE.UV(j,1-g),new THREE.UV(n,1-a)]:[new THREE.UV(c,1-f),new THREE.UV(i,1-e),new THREE.UV(l,1-g),new THREE.UV(m,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);a instanceof Array===false&&(a=[a]);this.shapebb=a[a.length-1].getBoundingBox();this.addShapeList(a,b);this.computeCentroids();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){b===void 0&&(b={});var c=b.material,d=b.UVGenerator===void 0?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,f,e,g,h=this.vertices.length;f=a.extractPoints();var i=f.shape,j=f.holes;if(!THREE.Shape.Utils.isClockWise(i)){i=i.reverse();f=0;for(e=j.length;f<e;f++){g=j[f];THREE.Shape.Utils.isClockWise(g)&&(j[f]=g.reverse())}}var l=THREE.Shape.Utils.triangulateShape(i,j);f=0;for(e=j.length;f<e;f++){g=j[f];i=i.concat(g)}j=i.length;e=l.length;for(f=
0;f<j;f++){g=i[f];this.vertices.push(new THREE.Vector3(g.x,g.y,0))}for(f=0;f<e;f++){j=l[f];i=j[2]+h;g=j[1]+h;j=j[0]+h;this.faces.push(new THREE.Face3(i,g,j,null,null,c));this.faceVertexUvs[0].push(d.generateBottomUV(this,a,b,i,g,j))}};
0;f<j;f++){g=i[f];this.vertices.push(new THREE.Vector3(g.x,g.y,0))}for(f=0;f<e;f++){j=l[f];i=j[0]+h;g=j[1]+h;j=j[2]+h;this.faces.push(new THREE.Face3(i,g,j,null,null,c));this.faceVertexUvs[0].push(d.generateBottomUV(this,a,b,i,g,j))}};
THREE.LatheGeometry=function(a,b,c){THREE.Geometry.call(this);for(var b=b||12,c=c||2*Math.PI,d=[],f=(new THREE.Matrix4).makeRotationZ(c/b),e=0;e<a.length;e++){d[e]=a[e].clone();this.vertices.push(d[e])}for(var g=b+1,c=0;c<g;c++)for(e=0;e<d.length;e++){d[e]=f.multiplyVector3(d[e].clone());this.vertices.push(d[e])}for(c=0;c<b;c++){d=0;for(f=a.length;d<f-1;d++){this.faces.push(new THREE.Face4(c*f+d,(c+1)%g*f+d,(c+1)%g*f+(d+1)%f,c*f+(d+1)%f));this.faceVertexUvs[0].push([new THREE.UV(1-c/b,d/f),new THREE.UV(1-
(c+1)/b,d/f),new THREE.UV(1-(c+1)/b,(d+1)/f),new THREE.UV(1-c/b,(d+1)/f)])}}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);
THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);for(var f=a/2,e=b/2,c=c||1,d=d||1,g=c+1,h=d+1,i=a/c,j=b/d,l=new THREE.Vector3(0,0,1),a=0;a<h;a++)for(b=0;b<g;b++)this.vertices.push(new THREE.Vector3(b*i-f,-(a*j-e),0));for(a=0;a<d;a++)for(b=0;b<c;b++){f=new THREE.Face4(b+g*a,b+g*(a+1),b+1+g*(a+1),b+1+g*a);f.normal.copy(l);f.vertexNormals.push(l.clone(),l.clone(),l.clone(),l.clone());this.faces.push(f);this.faceVertexUvs[0].push([new THREE.UV(b/c,1-a/d),new THREE.UV(b/c,1-(a+1)/d),new THREE.UV((b+
......
......@@ -67,7 +67,7 @@
// flat shape
var geometry = new THREE.ShapeGeometry( shape );
var material = new THREE.MeshBasicMaterial( { color: color, side: THREE.DoubleSide, overdraw: true } );
var material = new THREE.MeshBasicMaterial( { color: color, overdraw: true } );
var mesh = new THREE.Mesh( geometry, material );
mesh.position.set( x, y, z );
......@@ -277,7 +277,7 @@
addShape( triangleShape, 0xffee00, -180, 0, 0, 0, 0, 0, 1 );
addShape( roundedRectShape, 0x005500, -150, 150, 0, 0, 0, 0, 1 );
addShape( squareShape, 0x0055ff, 150, 100, 0, 0, 0, 0, 1 );
addShape( heartShape, 0xff1100, 40, 100, 0, 0, 0, Math.PI, 1 );
addShape( heartShape, 0xff1100, 60, 100, 0, 0, 0, Math.PI, 1 );
addShape( circleShape, 0x00ff11, 120, 250, 0, 0, 0, 0, 1 );
addShape( fishShape, 0x222222, -60, 200, 0, 0, 0, 0, 1 );
addShape( smileyShape, 0xee00ff, -200, 250, 0, 0, 0, Math.PI, 1 );
......
......@@ -342,10 +342,10 @@
addShape( triangleShape, extrudeSettings, 0xffee00, -180, 0, 0, 0, 0, 0, 1 );
addShape( roundedRectShape, extrudeSettings, 0x005500, -150, 150, 0, 0, 0, 0, 1 );
addShape( squareShape, extrudeSettings, 0x0055ff, 150, 100, 0, 0, 0, 0, 1 );
addShape( heartShape, extrudeSettings, 0xff1100, 0, 100, 0, Math.PI, 0, 0, 1 );
addShape( heartShape, extrudeSettings, 0xff1100, 60, 100, 0, 0, 0, Math.PI, 1 );
addShape( circleShape, extrudeSettings, 0x00ff11, 120, 250, 0, 0, 0, 0, 1 );
addShape( fishShape, extrudeSettings, 0x222222, -60, 200, 0, 0, 0, 0, 1 );
addShape( smileyShape, extrudeSettings, 0xee00ff, -270, 250, 0, Math.PI, 0, 0, 1 );
addShape( smileyShape, extrudeSettings, 0xee00ff, -200, 250, 0, 0, 0, Math.PI, 1 );
addShape( arcShape, extrudeSettings, 0xbb4422, 150, 0, 0, 0, 0, 0, 1 );
extrudeSettings.extrudePath = apath;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册