lerp function #106

Open
opened 2024-10-23 20:26:41 +02:00 by liquidex · 0 comments
Owner

Being able to linearly interpolate between vectors or colors using a numeric time value would be really useful. Currently you can write such a function, but it will only work for one type of value, since you cannot multiply a vector or color by a number, so you have to splat the value manually:

lerpVec = \a, b, t ->
  a + (b - a) * vec t t t t

lerpRgba = \a, b, t ->
  a + (b - a) * rgba t t t t
Being able to linearly interpolate between vectors or colors using a numeric time value would be really useful. Currently you can write such a function, but it will only work for one type of value, since you cannot multiply a vector or color by a number, so you have to splat the value manually: ``` lerpVec = \a, b, t -> a + (b - a) * vec t t t t lerpRgba = \a, b, t -> a + (b - a) * rgba t t t t ```
liquidex added the
c:haku
label 2024-10-23 20:26:41 +02:00
liquidex added this to the Backlog project 2024-10-23 20:26:41 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: liquidex/rkgk#106
No description provided.