SimpleVector vec = new SimpleVector(dir); Matrix back = cam.getBack();back = back.invert();vec.matMul(back);
SimpleVector xA = cam.getXAxis();SimpleVector yA = cam.getYAxis();SimpleVector zA = cam.getZAxis();SimpleVector vec = new SimpleVector();vec.x = dir.x * xA.x + dir.y * xA.y + dir.z * xA.z;vec.y = dir.x * yA.x + dir.y * yA.y + dir.z * yA.z;vec.z = dir.x * zA.x + dir.y * zA.y + dir.z * zA.z;