I had an assignment in school to create curves for a type of graph called Temporal Treemaps. I implemented my solution in a software called Inviwo, this is completely free and open source. I took some shortcuts when it came about to transferring data between so called modules. I did this by storing arrays of values in text files which I saved and loaded.
In short my solution to create graphs worked like the following: I found all points making up lines between sections of data. I used these lines to define one upper and one lower Bezier curve for each set of two triangles. This made it possible to discard unwanted fragments that were on the wrong side of these Bezier curves, in the frament shader. However, if I did this I would end up with white areas. The white areas was filled by drawing everything twice. First I drew everything with scaled triangles to cover up the white areas. Next, I drew normally sized triangles, to cover up for the ruffled cushion effects. My code for this solution is freely available on GitHub here:
https://github.com/marcus1337/InviwoTemporalTreeMapsMOD
 |
Before changes |
 |
Removing unwanted fragments |
 |
Scaling up triangles |
 |
Drawing twice to cover scaling |
Inga kommentarer:
Skicka en kommentar