I'm trying to get the distance between my light source and my cube face.
Im using this code to calculate it:
float xd = topCorners[4].x - sourceLocation.x;
float yd = topCorners[4].y - sourceLocation.y;
float zd = topCorners[4].z - sourceLocation.z;
float distance = (float) Math.sqrt((xd*xd) * (yd*yd) * (zd*zd));