public void extract1()
 {
  if (wrist==null) {System.err.println("Screwed! WRIST not found.!!"); return;}
  // Estimate ring base
  if (fing[PINKY][0]!=null && fing[MIDDLE][0]!=null)
   fing[RING][0]=new Point3d(0.5*(fing[PINKY][0].x+fing[MIDDLE][0].x),
                             0.5*(fing[PINKY][0].y+fing[MIDDLE][0].y),-1);


 // try to assign double colors to correct joints.
 // if visible use finger root else use wrist
 // if one of them is not visible assume visible is not the tip.
 Point3d q,base;
 for (int i=PINKY;i<=THUMB;i++)
  { 
   
    base=fing[i][0];
    if (base==null) base=wrist;
    double d1=dist(base,fing[i][1]);
    double d2=dist(base,fing[i][2]);
    if (d1>=0 && d2>=0)
     {
     if (d1>d2) {q=fing[i][1]; fing[i][1]=fing[i][2]; fing[i][2]=q;}
     }
    else
     {
     if (fing[i][1]==null) 
       {q=fing[i][1]; fing[i][1]=fing[i][2]; fing[i][2]=q;}
     }
  }  
 }