zzag / plasma5-wallpapers-dynamic

Dynamic wallpaper plugin for KDE Plasma
332 stars 18 forks source link

Option to ignore Azimuth when finding the closest point. #111

Closed jazz-g closed 2 years ago

jazz-g commented 2 years ago

It would be nice if there were a way to focus on altitude only, a possible way to enter this mode would be just omitting azimuth in the manifest file. The only workaround I found is to duplicate the images entries in the manifest file 4 times and assign each one an azimuth of 0, 90, 180, 270. This prevents shorter paths from around the back of the sphere. This of course makes the building time unnecessarily long, and the AVIF file unnecessarily big.

Edit: my workaround doesn't even work properly lol, it's displaying a picture meant for elevation of 3 when the sun is currently at an elevation of 67. I guess it does weird things around noon.

zzag commented 2 years ago

Azimuth influences whether the given image is used at sunrise or sunset. If you reuse the same image, the wallpaper size won't be increased drastically, the image will be stored only once.

jazz-g commented 2 years ago

If it's using the haversine formula to find the closest image to display, in many instances azimuth does change which image display in a way that's different from altitude. I've fixed my issue by changing the src/lib/ksunposition.cpp:195 to and always return 0 for azimuth and recompiling so future people know what I did.

zzag commented 2 years ago

If it's using the haversine formula to find the closest image to display

No, this plugin uses some trigonometry (sphere + plane intersections) to figure out what image to show. If there are better ways, PRs are welcome. :)