Vec3D a = getVertexAtCell((int) xx, (int) zz);
Vec3D b = getVertexAtCell(x2, (int) zz);
Vec3D c = getVertexAtCell(x2, z2);
Vec3D d = getVertexAtCell((int) xx, z2);
Ray3D r = new Ray3D(new Vec3D(x, 10000, z), new Vec3D(0, -1, 0));
TriangleIntersector i = new TriangleIntersector(new Triangle3D(a,
b, d));
if (i.intersectsRay(r)) {
isec = i.getIntersectionData();
} else {
i.setTriangle(new Triangle3D(b, c, d));
i.intersectsRay(r);
isec = i.getIntersectionData();
}
}
return isec;