protected void endShapeModelToCamera(int start, int stop) {
    for (int i = start; i < stop; i++) {
      float vertex[] = vertices[i];

      vertex[VX] =
        modelview.m00*vertex[X] + modelview.m01*vertex[Y] +
        modelview.m02*vertex[Z] + modelview.m03;
      vertex[VY] =
        modelview.m10*vertex[X] + modelview.m11*vertex[Y] +
        modelview.m12*vertex[Z] + modelview.m13;
      vertex[VZ] =
        modelview.m20*vertex[X] + modelview.m21*vertex[Y] +
        modelview.m22*vertex[Z] + modelview.m23;
      vertex[VW] =
        modelview.m30*vertex[X] + modelview.m31*vertex[Y] +
        modelview.m32*vertex[Z] + modelview.m33;

      // normalize
      if (vertex[VW] != 0 && vertex[VW] != 1) {
        vertex[VX] /= vertex[VW];
        vertex[VY] /= vertex[VW];
        vertex[VZ] /= vertex[VW];
      }
      vertex[VW] = 1;
    }
  }