Resizing shapes within a grid
I want to animate (resize) the shapes separately within my grid. I tried to animate the shapes by using the 'sample" node so far, which generates a random number but I want to input my own data.(see attached file)
For example: the first row of the grid should have shapes which are 10 width x 10 height.
I tried to import an csv file and link it to the shape node but it didn't seem to work.
Here is an animation of how it looks like right now with the "sample" node:
Thanks in advance!
- grid.PNG 32.1 KB
|?||Show this help|
|ESC||Blurs the current field|
|r||Focus the comment reply box|
|^ + ↩||Submit the comment|
You can use
Command ⌘ instead of
Control ^ on Mac
Support Staff 1 Posted by john on 02 Dec, 2017 10:19 PM
I am attaching a simple demo of how to read data from a csv and use it to size an array of dots.
For this demo I created a csv file of the seven dwarves. The table lists dwarf name (Doc, Grumpy, Happy, etc.) and weight. See first screenshot.
Everything in NodeBox runs off of lists. For this demo our ellipse node needs a list of 7 positions and another list of 7 sizes.
The grid node generates a list of positions. I set it to 4 x 4, so it would produce 16 positions. As we can tell from the count node, this data file only has seven rows, so I use the slice node to reduce the list to 7 positions. Positions are ordered left to right, top to bottom, so that creates one row of four and a second row of three.
To get our list of sizes we use a lookup node to retrieve numbers from the Weight column. We then feed those into the width and height ports of the ellipse node. See second screenshot.
That should give you a clearer understanding of how to size shapes from data. The zip file contains the NodeBox network and data file for you to play with.
I don't understand how you want to animate your dots. Using data to control every dot for every frame of an animation would require a larger and more complex dataset. Could you say more about what your data file looks like and exactly how you want to use that data to create an animation?
Good luck and please let me know if this helped and if you have further questions.