private boolean precomputeAccurateTexturing() {
    // rescale u/v_array values when inverting matrix and performing other calcs
    float myFact = 65500.0f;
    float myFact2 = 65500.0f;

    //Matrix inversion to find affine transform between (u,v,(1)) -> (x,y,z)

    // OPTIMIZE: There should be a way to avoid the inversion here, which is
    // quite expensive (~150 mults).  Also it might crap out due to loss of
    // precision depending on the scaling of the u/v_arrays.  Nothing clever
    // currently happens if the inversion fails, since this means the
    // transformation is degenerate - we just pass false back to the caller
    // and let it handle the situation. [There is no good solution to this
    // case from within this function, since the way the calculation proceeds
    // presumes a non-degenerate transformation matrix between camera space
    // and uv space]

    // Obvious optimization: if the vertices are actually at the appropriate
    // texture coordinates (e.g. (0,0), (TEX_WIDTH,0), and (0,TEX_HEIGHT))
    // then we can immediately return the right solution without the inversion.
    // This is fairly common, so could speed up many cases of drawing.
    // [not implemented]

    // Furthermore, we could cache the p,resultT0,result0T vectors in the
    // triangle's basis, since we could then do a look-up and generate the
    // resulting coordinates very simply. This would include the above
    // optimization as a special case - we could pre-populate the cache with
    // special cases like that and dynamically add more. The idea here is that
    // most people simply paste textures onto triangles and move the triangles
    // from frame to frame, so any per-triangle-per-frame code is likely
    // wasted effort. [not implemented]

    // Note: o0, o1, and o2 vary depending on view angle to triangle,
    // but p, n, and m should not depend on ordering differences

    if (firstSegment){
      PMatrix3D myMatrix = 
        new PMatrix3D(u_array[o0]/myFact, v_array[o0]/myFact2, 1, 0,
                    u_array[o1]/myFact, v_array[o1]/myFact2, 1, 0,
                    u_array[o2]/myFact, v_array[o2]/myFact2, 1, 0,
                    0,           0,           0, 1);
      // A 3x3 inversion would be more efficient here, 
      // given that the fourth r/c are unity
      myMatrix.invert();
      // if the matrix inversion had trouble, let the caller know
      if (myMatrix == null) return false;

      float m00, m01, m02, m10, m11, m12, m20, m21, m22;
      m00 = myMatrix.m00*camX[o0]+myMatrix.m01*camX[o1]+myMatrix.m02*camX[o2];
      m01 = myMatrix.m10*camX[o0]+myMatrix.m11*camX[o1]+myMatrix.m12*camX[o2];
      m02 = myMatrix.m20*camX[o0]+myMatrix.m21*camX[o1]+myMatrix.m22*camX[o2];
      m10 = myMatrix.m00*camY[o0]+myMatrix.m01*camY[o1]+myMatrix.m02*camY[o2];
      m11 = myMatrix.m10*camY[o0]+myMatrix.m11*camY[o1]+myMatrix.m12*camY[o2];
      m12 = myMatrix.m20*camY[o0]+myMatrix.m21*camY[o1]+myMatrix.m22*camY[o2];
      m20 = -(myMatrix.m00*camZ[o0]+myMatrix.m01*camZ[o1]+myMatrix.m02*camZ[o2]);
      m21 = -(myMatrix.m10*camZ[o0]+myMatrix.m11*camZ[o1]+myMatrix.m12*camZ[o2]);
      m22 = -(myMatrix.m20*camZ[o0]+myMatrix.m21*camZ[o1]+myMatrix.m22*camZ[o2]);

      float px = m02;
      float py = m12;
      float pz = m22;
      // Bugfix: possibly we should use F_TEX_WIDTH/HEIGHT instead?
      // Seems to read off end of array in that case, though...
      float resultT0x = m00*TEX_WIDTH+m02;
      float resultT0y = m10*TEX_WIDTH+m12;
      float resultT0z = m20*TEX_WIDTH+m22;
      float result0Tx = m01*TEX_HEIGHT+m02;
      float result0Ty = m11*TEX_HEIGHT+m12;
      float result0Tz = m21*TEX_HEIGHT+m22;
      float mx = resultT0x-m02;
      float my = resultT0y-m12;
      float mz = resultT0z-m22;
      float nx = result0Tx-m02;
      float ny = result0Ty-m12;
      float nz = result0Tz-m22;

      //avec = p x n
      ax = (py*nz-pz*ny)*TEX_WIDTH; //F_TEX_WIDTH/HEIGHT?
      ay = (pz*nx-px*nz)*TEX_WIDTH;
      az = (px*ny-py*nx)*TEX_WIDTH;
      //bvec = m x p
      bx = (my*pz-mz*py)*TEX_HEIGHT;
      by = (mz*px-mx*pz)*TEX_HEIGHT;
      bz = (mx*py-my*px)*TEX_HEIGHT;
      //cvec = n x m
      cx = ny*mz-nz*my;
      cy = nz*mx-nx*mz;
      cz = nx*my-ny*mx;
    }

    nearPlaneWidth = parent.rightScreen-parent.leftScreen;
    nearPlaneHeight = parent.topScreen-parent.bottomScreen;
    nearPlaneDepth = parent.nearPlane;
    // one pixel width in nearPlane coordinates
    xmult = nearPlaneWidth / SCREEN_WIDTH;
    ymult = nearPlaneHeight / SCREEN_HEIGHT;
    // Extra scalings to map screen plane units to pixel units
    newax = ax*xmult;
    newbx = bx*xmult;
    newcx = cx*xmult;
    return true;
  }