protected void lightDirection(int num, float x, float y, float z) {
    lightNormal[num].set(modelviewInv.m00*x + modelviewInv.m10*y + modelviewInv.m20*z + modelviewInv.m30,
                         modelviewInv.m01*x + modelviewInv.m11*y + modelviewInv.m21*z + modelviewInv.m31,
                         modelviewInv.m02*x + modelviewInv.m12*y + modelviewInv.m22*z + modelviewInv.m32);
    lightNormal[num].normalize();

    /*
    lightDirectionVec.set(x, y, z);
    System.out.println("dir vec " + lightDirectionVec);
    //modelviewInv.mult(lightDirectionVec, lightNormal[num]);
    modelviewInv.cmult(lightDirectionVec, lightNormal[num]);
    System.out.println("cmult vec " + lightNormal[num]);
    lightNormal[num].normalize();
    System.out.println("setting light direction " + lightNormal[num]);
    */

    /*
    // Multiply by inverse transpose.
    lightNormal[num][0] =
      modelviewInv.m00*x + modelviewInv.m10*y +
      modelviewInv.m20*z + modelviewInv.m30;
    lightNormal[num][1] =
      modelviewInv.m01*x + modelviewInv.m11*y +
      modelviewInv.m21*z + modelviewInv.m31;
    lightNormal[num][2] =
      modelviewInv.m02*x + modelviewInv.m12*y +
      modelviewInv.m22*z + modelviewInv.m32;

    float n = mag(lightNormal[num][0], lightNormal[num][1], lightNormal[num][2]);
    if (n == 0 || n == 1) return;

    lightNormal[num][0] /= n;
    lightNormal[num][1] /= n;
    lightNormal[num][2] /= n;
    */
  }