right now p5.strands doesn't support the regular p5 map() function inside shader callbacks. since map is one of the most used helpers in normal p5 sketches, not having it in strands means people end up rewriting it manually as something like start2 + (n - start1) / (stop1 - start1) * (stop2 - start2) every time.
would be nice to add it to the strands builtins so it just works the same way it does in regular p5 code.
something like:
map(n, start1, stop1, start2, stop2)
with the same signature as the cpu version. the withinBounds variant can probably come later if needed.
came up in a recent call, opening this so we have a place to track it.
right now p5.strands doesn't support the regular p5 map() function inside shader callbacks. since map is one of the most used helpers in normal p5 sketches, not having it in strands means people end up rewriting it manually as something like start2 + (n - start1) / (stop1 - start1) * (stop2 - start2) every time.
would be nice to add it to the strands builtins so it just works the same way it does in regular p5 code.
something like:
map(n, start1, stop1, start2, stop2)
with the same signature as the cpu version. the withinBounds variant can probably come later if needed.
came up in a recent call, opening this so we have a place to track it.