Convert from spherical coordinates to Cartesian coordinates(x, y, z)
| 667 | |
| 668 | // Convert from spherical coordinates to Cartesian coordinates(x, y, z) |
| 669 | inline Float3 SphericalToCartesian(float azimuth, float elevation) |
| 670 | { |
| 671 | Float3 xyz; |
| 672 | xyz.x = std::cos(azimuth) * std::cos(elevation); |
| 673 | xyz.y = std::sin(elevation); |
| 674 | xyz.z = std::sin(azimuth) * std::cos(elevation); |
| 675 | return xyz; |
| 676 | } |
| 677 | |
| 678 | inline Float2 CartesianToSpherical(const Float3& xyz) |
| 679 | { |