Hi,

I have a problem in building an extrusion Object. for example, I  have tried
to produce a truncted cone with a top-radius, bottom-radius and a height. My
programm just display me a top (or maybe bottom) circular face, I can not
find the body part.  could you please have a look at my code and tell me
what's wrong in my programm.

Here is my codes.

/////////////////////////////

   int[] stripCounts=new int [2];
   Point3d[] coordinates=new Point3d[48];
   Point3d[] bottom_coordinates=new Point3d[25];

   stripCounts[0]=24; stripCounts[1]=24;
   // Globally used colors


   TransformGroup objTrans = new TransformGroup();
   /Appearance ap = new Appearance();



     for (j=0; j<24; j++)
     {
      ct=15.0d*j/180*3.14159;
    // computer the top polygon points
      top_vertice[j][0]=top_R*Math.cos(ct);top_vertice[j][1]=hy;
top_vertice[j][2]=top_R*Math.sin(ct);
      coordinates[j]=new
Point3d(top_vertice[j][0],top_vertice[j][1],top_vertice[j][2]);
    //compute the bottom polygon points
      bottom_vertice[j][0]=bottom_R*Math.cos(ct); bottom_vertice[j][1]=-hy;
bottom_vertice[j][2]                =bottom_R*Math.sin(ct);
      bottom_coordinates[j]=new
Point3d(bottom_vertice[j][0],bottom_vertice[j][1],bottom_vertice[j][1]);
     }
    //merge coordates
     for(j=0;j<24;j++)
     coordinates[j+24]=bottom_coordinates[j];

       GeometryInfo gi = new GeometryInfo(GeometryInfo.POLYGON_ARRAY);

       gi.setStripCounts(stripCounts);//

       gi.setCoordinates(coordinates);

       Triangulator tr = new Triangulator();
       tr.triangulate(gi);

       NormalGenerator ng = new NormalGenerator();
       ng.generateNormals(gi);


       Shape3D part = new Shape3D();
       part.setAppearance(ap);
       part.setGeometry(gi.getGeometryArray());
       objTrans.addChild(part);


   }

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to