Ejemplo n.º 1
0
 public virtual void render(Cylinder cyl)
 {
     render(ref cyl, 32);
 }
Ejemplo n.º 2
0
 public virtual void render(Cylinder cyl, int segments)
 {
     render(ref cyl, segments);
 }
Ejemplo n.º 3
0
        // Gets the points of a cylinder
        public static Point[] getCylinderPoints(Cylinder circ, int segments)
        {
            // Variables
            Point[]	points=	new Point[((circ.height== 0f) ? segments+1 : segments*2+1)];

            for(int i= 0; i<= segments; i++)
            {
                points[i]=	new Point(
                    circ.radius*(float)(Math.Cos(((float)i/(float)segments)*TWO_PI))+circ.centerPosition.x,
                    circ.radius*(float)(Math.Sin(((float)i/(float)segments)*TWO_PI))+circ.centerPosition.y,
                    circ.centerPosition.z
                );
            }
            if(circ.height!= 0f)
            {
                for(int i= segments+1; i<= segments*2; i++)
                {
                    points[i]=	new Point(
                        points[i-segments].x,
                        points[i-segments].y,
                        points[i-segments].z+circ.height
                    );
                }
            }

            return points;
        }
Ejemplo n.º 4
0
 // Renders a cylinder
 public abstract void render(ref Cylinder cyl, int segments);
 // Renders a cylinder
 public override void render(Cylinder cyl)
 {
 }