| 39 | } |
| 40 | |
| 41 | sibr::Vector2d cartesianToSpherical(const sibr::Vector3d & dir) |
| 42 | { |
| 43 | double theta = std::acos(dir.z()); |
| 44 | |
| 45 | double phi = 0; |
| 46 | if (dir.x() != 0 && dir.y() != 0) { |
| 47 | phi = std::atan2(dir.y(), dir.x()); |
| 48 | } |
| 49 | |
| 50 | return sibr::Vector2d(phi, theta); |
| 51 | } |
| 52 | |
| 53 | sibr::Vector2d cartesianToSphericalUVs(const sibr::Vector3d & dir) |
| 54 | { |
no outgoing calls
no test coverage detected