提交 6141390d 编写于 作者: M Mr.doob

Simplified `CylinderGeometry` params.

上级 f849f34b
因为 它太大了无法显示 source diff 。你可以改为 查看blob
......@@ -132,11 +132,11 @@ THREE.CubeGeometry=function(a,b,c,e,h,g,f,k,l){function m(a,c,b,f,k,l,m,o){var t
L,l+N*(p+1)+L,l+1+N*(p+1)+L,l+1+N*p+L,null,null,o)),n.faceVertexUvs[0].push([new THREE.UV(l/x,p/v),new THREE.UV(l/x,(p+1)/v),new THREE.UV((l+1)/x,(p+1)/v),new THREE.UV((l+1)/x,p/v)])}THREE.Geometry.call(this);var n=this,o=a/2,p=b/2,t=c/2,k=k?-1:1;if(f!==void 0)if(f instanceof Array)this.materials=f;else{this.materials=[];for(var x=0;x<6;x++)this.materials.push([f])}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(l!=void 0)for(var v in l)this.sides[v]!=void 0&&(this.sides[v]=
l[v]);this.sides.px&&m("z","y",1*k,-1,c,b,-o,this.materials[0]);this.sides.nx&&m("z","y",-1*k,-1,c,b,o,this.materials[1]);this.sides.py&&m("x","z",1*k,1,a,c,p,this.materials[2]);this.sides.ny&&m("x","z",1*k,-1,a,c,-p,this.materials[3]);this.sides.pz&&m("x","y",1*k,-1,a,b,t,this.materials[4]);this.sides.nz&&m("x","y",-1*k,-1,a,b,-t,this.materials[5]);(function(){for(var a=[],c=[],b=0,e=n.vertices.length;b<e;b++){for(var f=n.vertices[b],g=!1,h=0,k=a.length;h<k;h++){var l=a[h];if(f.position.x==l.position.x&&
f.position.y==l.position.y&&f.position.z==l.position.z){c[b]=h;g=!0;break}}if(!g)c[b]=a.length,a.push(new THREE.Vertex(f.position.clone()))}b=0;for(e=n.faces.length;b<e;b++)f=n.faces[b],f.a=c[f.a],f.b=c[f.b],f.c=c[f.c],f.d=c[f.d];n.vertices=a})();this.computeCentroids();this.computeFaceNormals()};THREE.CubeGeometry.prototype=new THREE.Geometry;THREE.CubeGeometry.prototype.constructor=THREE.CubeGeometry;
THREE.CylinderGeometry=function(a,b,c,e,h,g){THREE.Geometry.call(this);var a=a||20,h=h!=null?h:a,g=g!=null?g:a,b=b||100,f=b/2,c=c||8,e=e||1,k,l,m=[],n=[];for(l=0;l<=e;l++){var o=[],p=[],t=l/e,a=t*(g-h)+h;for(k=0;k<=c;k++){var x=k/c;this.vertices.push(new THREE.Vertex(new THREE.Vector3(a*Math.sin(x*Math.PI*2),-t*b+f,a*Math.cos(x*Math.PI*2))));o.push(this.vertices.length-1);p.push(new THREE.UV(x,t))}m.push(o);n.push(p)}for(l=0;l<e;l++)for(k=0;k<c;k++){var a=m[l][k],b=m[l+1][k],o=m[l+1][k+1],p=m[l][k+
1],t=this.vertices[a].position.clone().setY(0).normalize(),x=this.vertices[b].position.clone().setY(0).normalize(),v=this.vertices[o].position.clone().setY(0).normalize(),u=this.vertices[p].position.clone().setY(0).normalize(),z=n[l][k].clone(),y=n[l+1][k].clone(),w=n[l+1][k+1].clone(),A=n[l][k+1].clone();this.faces.push(new THREE.Face4(a,b,o,p,[t,x,v,u]));this.faceVertexUvs[0].push([z,y,w,A])}if(h>0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,f,0)));for(k=0;k<c;k++)a=m[0][k],b=m[0][k+
1],o=this.vertices.length-1,t=new THREE.Vector3(0,1,0),x=new THREE.Vector3(0,1,0),v=new THREE.Vector3(0,1,0),z=n[0][k].clone(),y=n[0][k+1].clone(),w=new THREE.UV,this.faces.push(new THREE.Face3(a,b,o,[t,x,v])),this.faceVertexUvs[0].push([z,y,w])}if(g>0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-f,0)));for(k=0;k<c;k++)a=m[l][k],b=this.vertices.length-1,o=m[l][k+1],t=new THREE.Vector3(0,-1,0),x=new THREE.Vector3(0,-1,0),v=new THREE.Vector3(0,-1,0),z=n[l][k].clone(),y=new THREE.UV(1,1),
w=n[l][k+1].clone(),this.faces.push(new THREE.Face3(a,b,o,[t,x,v])),this.faceVertexUvs[0].push([z,y,w])}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=new THREE.Geometry;THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
THREE.ExtrudeGeometry=function(a,b){if(typeof a!="undefined"){THREE.Geometry.call(this);var a=a instanceof Array?a:[a],c,e=a.length,h;this.shapebb=a[e-1].getBoundingBox();for(c=0;c<e;c++)h=a[c],this.addShape(h,b);this.computeCentroids();this.computeFaceNormals()}};THREE.ExtrudeGeometry.prototype=new THREE.Geometry;THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;
THREE.CylinderGeometry=function(a,b,c,e,h){THREE.Geometry.call(this);var a=a!=null?a:20,b=b!=null?b:20,c=c||100,g=c/2,e=e||8,h=h||1,f,k,l=[],m=[];for(k=0;k<=h;k++){var n=[],o=[],p=k/h,t=p*(b-a)+a;for(f=0;f<=e;f++){var x=f/e;this.vertices.push(new THREE.Vertex(new THREE.Vector3(t*Math.sin(x*Math.PI*2),-p*c+g,t*Math.cos(x*Math.PI*2))));n.push(this.vertices.length-1);o.push(new THREE.UV(x,p))}l.push(n);m.push(o)}for(k=0;k<h;k++)for(f=0;f<e;f++){var c=l[k][f],n=l[k+1][f],o=l[k+1][f+1],p=l[k][f+1],t=this.vertices[c].position.clone().setY(0).normalize(),
x=this.vertices[n].position.clone().setY(0).normalize(),v=this.vertices[o].position.clone().setY(0).normalize(),u=this.vertices[p].position.clone().setY(0).normalize(),z=m[k][f].clone(),y=m[k+1][f].clone(),w=m[k+1][f+1].clone(),A=m[k][f+1].clone();this.faces.push(new THREE.Face4(c,n,o,p,[t,x,v,u]));this.faceVertexUvs[0].push([z,y,w,A])}if(a>0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,g,0)));for(f=0;f<e;f++)c=l[0][f],n=l[0][f+1],o=this.vertices.length-1,t=new THREE.Vector3(0,1,0),x=
new THREE.Vector3(0,1,0),v=new THREE.Vector3(0,1,0),z=m[0][f].clone(),y=m[0][f+1].clone(),w=new THREE.UV,this.faces.push(new THREE.Face3(c,n,o,[t,x,v])),this.faceVertexUvs[0].push([z,y,w])}if(b>0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-g,0)));for(f=0;f<e;f++)c=l[k][f],n=this.vertices.length-1,o=l[k][f+1],t=new THREE.Vector3(0,-1,0),x=new THREE.Vector3(0,-1,0),v=new THREE.Vector3(0,-1,0),z=m[k][f].clone(),y=new THREE.UV(1,1),w=m[k][f+1].clone(),this.faces.push(new THREE.Face3(c,n,
o,[t,x,v])),this.faceVertexUvs[0].push([z,y,w])}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=new THREE.Geometry;THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;THREE.ExtrudeGeometry=function(a,b){if(typeof a!="undefined"){THREE.Geometry.call(this);var a=a instanceof Array?a:[a],c,e=a.length,h;this.shapebb=a[e-1].getBoundingBox();for(c=0;c<e;c++)h=a[c],this.addShape(h,b);this.computeCentroids();this.computeFaceNormals()}};
THREE.ExtrudeGeometry.prototype=new THREE.Geometry;THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;
THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,c,b){c||console.log("die");return c.clone().multiplyScalar(b).addSelf(a)}function e(a,c,b){var e=THREE.ExtrudeGeometry.__v1,f=THREE.ExtrudeGeometry.__v2,g=THREE.ExtrudeGeometry.__v3,h=THREE.ExtrudeGeometry.__v4,k=THREE.ExtrudeGeometry.__v5,l=THREE.ExtrudeGeometry.__v6;e.set(a.x-c.x,a.y-c.y);f.set(a.x-b.x,a.y-b.y);e=e.normalize();f=f.normalize();g.set(-e.y,e.x);h.set(f.y,-f.x);k.copy(a).addSelf(g);l.copy(a).addSelf(h);if(k.equals(l))return h.clone();
k.copy(c).addSelf(g);l.copy(b).addSelf(h);g=e.dot(h);h=l.subSelf(k).dot(h);g==0&&(console.log("Either infinite or no solutions!"),h==0?console.log("Its finite solutions."):console.log("Too bad, no solutions."));h/=g;if(h<0)return c=Math.atan2(c.y-a.y,c.x-a.x),a=Math.atan2(b.y-a.y,b.x-a.x),c>a&&(a+=Math.PI*2),anglec=(c+a)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return e.multiplyScalar(h).addSelf(k).subSelf(a).clone()}function h(a){for(B=a.length;--B>=0;){T=B;R=B-1;R<0&&(R=a.length-
1);for(var c=0,b=t+n*2,c=0;c<b;c++){var e=P*c,f=P*(c+1),g=Q+T+e,h=Q+T+f,m=g,e=Q+R+e,f=Q+R+f,o=h;m+=M;e+=M;f+=M;o+=M;H.faces.push(new THREE.Face4(m,e,f,o,null,null,A));A&&(m=c/b,e=(c+1)/b,f=k+l*2,g=(H.vertices[g].position.z+l)/f,h=(H.vertices[h].position.z+l)/f,H.faceVertexUvs[0].push([new THREE.UV(g,m),new THREE.UV(h,m),new THREE.UV(h,e),new THREE.UV(g,e)]))}}}function g(a,c,b){H.vertices.push(new THREE.Vertex(new THREE.Vector3(a,c,b)))}function f(a,c,b){a+=M;c+=M;b+=M;H.faces.push(new THREE.Face3(a,
......@@ -267,7 +267,7 @@ p,t,x,v,u,z,y,w,A,C,F,G,I,H,M,B,D,J,L,N,K,P,E;D=a.data;H=new THREE.BinaryLoader;
A[1],A[2]);S&&E.scene.scale.set(S[0],S[1],S[2]);(a||A||S)&&E.scene.updateMatrix()}a=function(){N-=1;n();c.onLoadComplete()};for(v in D.cameras){A=D.cameras[v];if(A.type=="perspective")G=new THREE.Camera(A.fov,A.aspect,A.near,A.far);else if(A.type=="ortho")G=new THREE.Camera,G.projectionMatrix=THREE.Matrix4.makeOrtho(A.left,A.right,A.top,A.bottom,A.near,A.far);w=A.position;A=A.target;G.position.set(w[0],w[1],w[2]);G.target.position.set(A[0],A[1],A[2]);E.cameras[v]=G}for(x in D.lights)v=D.lights[x],
G=v.color!==void 0?v.color:16777215,A=v.intensity!==void 0?v.intensity:1,v.type=="directional"?(w=v.direction,B=new THREE.DirectionalLight(G,A),B.position.set(w[0],w[1],w[2]),B.position.normalize()):v.type=="point"?(w=v.position,d=v.distance,B=new THREE.PointLight(G,A,d),B.position.set(w[0],w[1],w[2])):v.type=="ambient"&&(B=new THREE.AmbientLight(G)),E.scene.addLight(B),E.lights[x]=B;for(u in D.fogs)x=D.fogs[u],x.type=="linear"?I=new THREE.Fog(0,x.near,x.far):x.type=="exp2"&&(I=new THREE.FogExp2(0,
x.density)),A=x.color,I.color.setRGB(A[0],A[1],A[2]),E.fogs[u]=I;if(E.cameras&&D.defaults.camera)E.currentCamera=E.cameras[D.defaults.camera];if(E.fogs&&D.defaults.fog)E.scene.fog=E.fogs[D.defaults.fog];A=D.defaults.bgcolor;E.bgColor=new THREE.Color;E.bgColor.setRGB(A[0],A[1],A[2]);E.bgColorAlpha=D.defaults.bgalpha;for(o in D.geometries)if(u=D.geometries[o],u.type=="bin_mesh"||u.type=="ascii_mesh")L+=1,c.onLoadStart();K=L;for(o in D.geometries)u=D.geometries[o],u.type=="cube"?(F=new THREE.CubeGeometry(u.width,
u.height,u.depth,u.segmentsWidth,u.segmentsHeight,u.segmentsDepth,null,u.flipped,u.sides),E.geometries[o]=F):u.type=="plane"?(F=new THREE.PlaneGeometry(u.width,u.height,u.segmentsWidth,u.segmentsHeight),E.geometries[o]=F):u.type=="sphere"?(F=new THREE.SphereGeometry(u.radius,u.segmentsWidth,u.segmentsHeight),E.geometries[o]=F):u.type=="cylinder"?(F=new THREE.CylinderGeometry(u.topRad,u.height,u.numSegs,1,u.topRad,u.botRad),E.geometries[o]=F):u.type=="torus"?(F=new THREE.TorusGeometry(u.radius,u.tube,
u.height,u.depth,u.segmentsWidth,u.segmentsHeight,u.segmentsDepth,null,u.flipped,u.sides),E.geometries[o]=F):u.type=="plane"?(F=new THREE.PlaneGeometry(u.width,u.height,u.segmentsWidth,u.segmentsHeight),E.geometries[o]=F):u.type=="sphere"?(F=new THREE.SphereGeometry(u.radius,u.segmentsWidth,u.segmentsHeight),E.geometries[o]=F):u.type=="cylinder"?(F=new THREE.CylinderGeometry(u.topRad,u.botRad,u.height,u.radSegs,u.heightSegs),E.geometries[o]=F):u.type=="torus"?(F=new THREE.TorusGeometry(u.radius,u.tube,
u.segmentsR,u.segmentsT),E.geometries[o]=F):u.type=="icosahedron"?(F=new THREE.IcosahedronGeometry(u.subdivisions),E.geometries[o]=F):u.type=="bin_mesh"?H.load({model:e(u.url,D.urlBaseType),callback:l(o)}):u.type=="ascii_mesh"?J.load({model:e(u.url,D.urlBaseType),callback:l(o)}):u.type=="embedded_mesh"&&(u=D.embeds[u.id])&&J.createModel(u,m(o),"");for(z in D.textures)if(o=D.textures[z],o.url instanceof Array){N+=o.url.length;for(H=0;H<o.url.length;H++)c.onLoadStart()}else N+=1,c.onLoadStart();P=N;
for(z in D.textures){o=D.textures[z];if(o.mapping!=void 0&&THREE[o.mapping]!=void 0)o.mapping=new THREE[o.mapping];if(o.url instanceof Array){H=[];for(var O=0;O<o.url.length;O++)H[O]=e(o.url[O],D.urlBaseType);H=THREE.ImageUtils.loadTextureCube(H,o.mapping,a)}else{H=THREE.ImageUtils.loadTexture(e(o.url,D.urlBaseType),o.mapping,a);if(THREE[o.minFilter]!=void 0)H.minFilter=THREE[o.minFilter];if(THREE[o.magFilter]!=void 0)H.magFilter=THREE[o.magFilter];if(o.repeat){H.repeat.set(o.repeat[0],o.repeat[1]);
if(o.repeat[0]!=1)H.wrapS=THREE.RepeatWrapping;if(o.repeat[1]!=1)H.wrapT=THREE.RepeatWrapping}o.offset&&H.offset.set(o.offset[0],o.offset[1]);if(o.wrap){J={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(J[o.wrap[0]]!==void 0)H.wrapS=J[o.wrap[0]];if(J[o.wrap[1]]!==void 0)H.wrapT=J[o.wrap[1]]}}E.textures[z]=H}for(p in D.materials){z=D.materials[p];for(C in z.parameters)if(C=="envMap"||C=="map"||C=="lightMap")z.parameters[C]=E.textures[z.parameters[C]];else if(C=="shading")z.parameters[C]=
......@@ -317,7 +317,7 @@ THREE.triTable=new Int32Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0
4,1,4,0,7,4,11,-1,-1,-1,-1,3,1,4,3,4,8,1,10,4,7,4,11,10,11,4,-1,4,11,7,9,11,4,9,2,11,9,1,2,-1,-1,-1,-1,9,7,4,9,11,7,9,1,11,2,11,1,0,8,3,-1,11,7,4,11,4,2,2,4,0,-1,-1,-1,-1,-1,-1,-1,11,7,4,11,4,2,8,3,4,3,2,4,-1,-1,-1,-1,2,9,10,2,7,9,2,3,7,7,4,9,-1,-1,-1,-1,9,10,7,9,7,4,10,2,7,8,7,0,2,0,7,-1,3,7,10,3,10,2,7,4,10,1,10,0,4,0,10,-1,1,10,2,8,7,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,7,1,3,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,0,8,1,8,7,1,-1,-1,-1,-1,4,0,3,7,4,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,8,7,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,10,8,10,11,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,11,9,10,-1,-1,-1,-1,-1,-1,-1,0,1,10,0,10,8,8,10,11,-1,-1,-1,-1,-1,-1,-1,3,1,10,11,3,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,11,1,11,9,9,11,8,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,1,2,9,2,11,9,-1,-1,-1,-1,0,2,11,8,0,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,2,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,10,8,9,-1,-1,-1,-1,-1,-1,-1,9,10,2,0,9,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,0,1,8,1,10,8,-1,-1,-1,-1,1,10,
2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,3,8,9,1,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,9,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,3,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]);
THREE.Trident=function(){THREE.Object3D.call(this);var a=new THREE.Geometry;a.vertices.push(new THREE.Vertex);a.vertices.push(new THREE.Vertex(new THREE.Vector3(0,100,0)));var b=new THREE.CylinderGeometry(5,25,5,1,0,5),c=new THREE.Line(a,new THREE.LineBasicMaterial({color:16711680}));c.rotation.z=-Math.PI/2;this.add(c);c=new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:16711680}));c.position.x=100;c.rotation.z=-Math.PI/2;this.add(c);c=new THREE.Line(a,new THREE.LineBasicMaterial({color:65280}));
THREE.Trident=function(){THREE.Object3D.call(this);var a=new THREE.Geometry;a.vertices.push(new THREE.Vertex);a.vertices.push(new THREE.Vertex(new THREE.Vector3(0,100,0)));var b=new THREE.CylinderGeometry(0,5,25,5,1),c=new THREE.Line(a,new THREE.LineBasicMaterial({color:16711680}));c.rotation.z=-Math.PI/2;this.add(c);c=new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:16711680}));c.position.x=100;c.rotation.z=-Math.PI/2;this.add(c);c=new THREE.Line(a,new THREE.LineBasicMaterial({color:65280}));
this.add(c);c=new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:65280}));c.position.y=100;this.add(c);c=new THREE.Line(a,new THREE.LineBasicMaterial({color:255}));c.rotation.x=Math.PI/2;this.add(c);c=new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:255}));c.position.z=100;c.rotation.x=Math.PI/2;this.add(c)};THREE.Trident.prototype=new THREE.Object3D;THREE.Trident.prototype.constructor=THREE.Trident;THREE.PlaneCollider=function(a,b){this.point=a;this.normal=b};
THREE.SphereCollider=function(a,b){this.center=a;this.radius=b;this.radiusSq=b*b};THREE.BoxCollider=function(a,b){this.min=a;this.max=b;this.dynamic=!0;this.normal=new THREE.Vector3};THREE.MeshCollider=function(a,b){this.mesh=a;this.box=b;this.numFaces=this.mesh.geometry.faces.length;this.normal=new THREE.Vector3};THREE.CollisionSystem=function(){this.collisionNormal=new THREE.Vector3;this.colliders=[];this.hits=[]};THREE.Collisions=new THREE.CollisionSystem;
THREE.CollisionSystem.prototype.merge=function(a){this.colliders=this.colliders.concat(a.colliders);this.hits=this.hits.concat(a.hits)};THREE.CollisionSystem.prototype.rayCastAll=function(a){a.direction.normalize();this.hits.length=0;var b,c,e,h,g=0;b=0;for(c=this.colliders.length;b<c;b++)if(h=this.colliders[b],e=this.rayCast(a,h),e<Number.MAX_VALUE)h.distance=e,e>g?this.hits.push(h):this.hits.unshift(h),g=e;return this.hits};
......
......@@ -186,22 +186,20 @@ var scene = {
"cylinder": {
"type" : "cylinder",
"numSegs" : 32,
"topRad" : 5,
"botRad" : 5,
"height" : 50,
"topOffset": 0,
"botOffset": 0
"radSegs" : 32,
"heightSegs": 1
},
"cone": {
"type" : "cylinder",
"numSegs" : 32,
"topRad" : 0,
"botRad" : 5,
"height" : 50,
"topOffset": 0,
"botOffset": 0
"radSegs" : 32,
"heightSegs" : 1
},
"WaltHead": {
......
......@@ -66,7 +66,7 @@
scene.add( object );
objects[ 1 ] = object = new THREE.Mesh( new THREE.CylinderGeometry( 50, 100, 40, 5, 25, 75 ), material );
objects[ 1 ] = object = new THREE.Mesh( new THREE.CylinderGeometry( 25, 75, 100, 40, 5 ), material );
object.position.z = 200;
scene.add( object );
......
......@@ -2,13 +2,12 @@
* @author mr.doob / http://mrdoob.com/
*/
THREE.CylinderGeometry = function ( radius, height, segmentsRadius, segmentsHeight, radiusTop, radiusBottom ) {
THREE.CylinderGeometry = function ( radiusTop, radiusBottom, height, segmentsRadius, segmentsHeight ) {
THREE.Geometry.call( this );
var radius = radius || 20;
var radiusTop = radiusTop != null ? radiusTop : radius;
var radiusBottom = radiusBottom != null ? radiusBottom : radius;
var radiusTop = radiusTop != null ? radiusTop : 20;
var radiusBottom = radiusBottom != null ? radiusBottom : 20;
var height = height || 100;
var heightHalf = height / 2;
var segmentsX = segmentsRadius || 8;
......
......@@ -502,7 +502,7 @@ THREE.SceneLoader.prototype = {
} else if ( g.type == "cylinder" ) {
geometry = new THREE.CylinderGeometry( g.topRad, g.height, g.numSegs, 1, g.topRad, g.botRad );
geometry = new THREE.CylinderGeometry( g.topRad, g.botRad, g.height, g.radSegs, g.heightSegs );
result.geometries[ dg ] = geometry;
} else if ( g.type == "torus" ) {
......
......@@ -11,7 +11,7 @@ THREE.Trident = function () {
lineGeometry.vertices.push( new THREE.Vertex() );
lineGeometry.vertices.push( new THREE.Vertex( new THREE.Vector3( 0, 100, 0 ) ) );
var coneGeometry = new THREE.CylinderGeometry( 5, 25, 5, 1, 0, 5 );
var coneGeometry = new THREE.CylinderGeometry( 0, 5, 25, 5, 1 );
// x
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册