Hey y'all. I'm working towards a library for rende...
# share-your-work
e
Hey y'all. I'm working towards a library for rendering and adding direct-manipulation to infinite recursive things. I want to share this picture showing where I'm at. On the left is the rendered infinite recursive thing. On the right is the diagrammatic specification for the thing on the left. The library interprets the diagrammatic spec and produces a program that takes the initial transformation (position, rotation, scale, and skew) of a shape (data for a
t
in the diagram), and then runs forever, adding more shapes to the left and the right as it runs. The arrows in the spec mean "depends on", and the lines mean "depends on" both ways. I could have drawn the lines as two-sided arrows but I found that it was harder to read. Explaining this now I realize its kind of confusing tho lol. The self-loop on the
t
in the spec is what makes the resulting diagram recursive, otherwise it would be a single red, green, and blue thing. Currently the diagrammatic spec is actually specified in text šŸ˜
i
The little inline colored shape previews in the diagram are nice. I'm excited to see more examples of different diagrams and recursive things, since at the moment I'm sort of guessing at what the diagram means :)
c
@Elliot i was wondering what the diagrammatic text for this example looks like? Im still trying to understand what the visual diagram representsā€¦ but i really like this exploration!
e
The diagram / code specifies the relationships between the various parts of the recursive diagram. The way things are specified is related to functional reactive programming/observables. For an example, the
basis
data is made out of
red
and
blue
vector data. If the
red
or
blue
vector data changes, then that causes the
basis
data to change.
The nodes in the diagram are sort of like classes that get instantiated to render something. The funky thing about the library is that the classes can be related to themselves, and that's how you get recursion. For example,
t
is related to
basis
and
origin
(its made out of those two pieces of data joined together) and
t
is related to itself. So you get recursive copies of
t
and everything it is related to.
Let me know if that makes any sort of sense lol
i
Sort of! I'm sure it'll make more sense as you do more with it and I have more exposure to it.