There is this one convenience function I always end up using in graphics programming that I honestly can't live without. When a friend first showed it to me, he called it remap(), and I've just kept the name. Maps a value from 1 range to another.
-
Näytä tämä ketju
remap(v, s0, e0, s1, e1) (s=start, e=end) Basically it's implemented like: lerp(s1, e1, inverseLerp(s0, e0, v)); I use it all the time. UI coords to Screen space, normalize height data to scaled height position. So many others.
7.36 - 22. tammik. 2020
0 vastausta
0 uudelleentwiittausta
1 tykkäys
Lataaminen näyttää kestävän hetken.
Twitter saattaa olla ruuhkautunut tai ongelma on muuten hetkellinen. Yritä uudelleen tai käy Twitterin tilasivulla saadaksesi lisätietoja.