michal Posted October 14, 2021 Posted October 14, 2021 Hello, everyone, can you give me any advice on how to get a vector described by azimuth and elevation of the sun. See the picture. Thank you for any help. Michal
cash-metall Posted October 15, 2021 Posted October 15, 2021 Hello! try something like this: vec3 sun_dir = sun->getWorldDirection(AXIS_Z); float azimuth = Math::atan2(sun_dir.x, sun_dir.y) * Math::Consts::RAD2DEG float elevation = Math::acos(clamp(-sun_dir.z, -1.0f, 1.0f)) * Math::Consts::RAD2DEG - 90.0f 1 1
michal Posted October 15, 2021 Author Posted October 15, 2021 Thank you very much , it is works as I expected
Recommended Posts