ConvexHull3D() throws IOException {
    list = new cVertexList();
    elist = new cEdgeList();
    flist = new cFaceList();
    debug = toDraw = false;
    check = false;
    String s;

    char c;
    char line[] = new char[20];
    int i = 0;
    int x, y, z;
    boolean flag;
    int counter;

    System.out.println("\n\nInput points:\nCoord-s must be seperated by a *tab*\n"+
		       "ENTER after each point"+"\nTo finish input type end + "+
		       "ENTER at the end"+
		       "\nExample:\n17      23      123\n34      5      1\nend\n"+
		       "-----------------start entering data-------------------");
    do {
      do {
	c = (char) System.in.read();
	line[i] = c;
	i++;
      } while (c !='\n' );
      s = new String(line);
      s = s.substring(0,i-1);
      if (s.equals("end"))
	break;
      flag = false;
      counter = 0;
      for (int j=0; j < s.length(); j++) {
	if (s.charAt(j) == '\t') 
	  counter++; 
	if (counter == 2) {
	  flag = true; break; 
	}
      }
      if (flag) {
	int t = s.indexOf('\t');
	int t1 = s.lastIndexOf('\t');
	x = Integer.parseInt(s.substring(0,t));
	y = Integer.parseInt(s.substring(t+1,t1));
	z = Integer.parseInt(s.substring(t1+1,s.length()));
	list.SetVertex3D(x,y,z);
	i=0;
      }
      else 
	break;
    } while (!s.equals("end"));

    ReadVertices();
    System.out.println("Data was accepted");
    list.PrintVertices3D();
    System.out.println("Calculating convex hull...");

    if (DoubleTriangle()) {
      toDraw = true;
      ConstructHull();
      Print();
      ClearLists();
    }
  }