Brush effects / reticle system #12
Labels
No labels
bug
c:haku
c:rkgk backend
c:rkgk frontend
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: liquidex/rkgk#12
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The PLT side, not the visual side.
Basically I'd like brushes to accept parameters, and that requires injecting them via an effect. This would become the basis of our reticle system for the future.
Essentially, instead of just drawing at
(vec)
, you declare that you'd like to have a "plotter" reticle tell you where to draw:and then the plotter reticle renders your brush in a roughly 500x500 area around it.
Likewise we'd later get
(with-rectangle)
,(with-polyline)
,(with-polygon)
, etc. but that's unnecessary for this prototype.To kick off, now that we have the new haku syntax, let's define
withDotter
to be a reticle that draws dots at the mouse cursor.Usage:
d
is a function that, when provided an argument for what type of data you'd like to extract, provides you with that data stored in the dotter. A dotter will store the following data types:What will make reticles especially powerful is that
From
andTo
will give you global coordinates, so you'll be able to draw pixels dependent on the position of the cursor on the canvas.To help with the current ongoing issue of brushes leaving visible gaps between dots, a dotter is going to have access to the previous mouse position in addition to the current position. That way you can fill in the gap however you want.
Something that will not be done for now is equally subdividing or smoothing out the points anyhow. For that I'd like to have a more powerful interface you can move on to if you want more advanced controls.