Creating a Grid of lines from (modifiable) vertices

Hey,

I am trying to create a grid or mesh by defining vertices/points in space, which should be connected through lines. I want to modify the coordinates of the points individually, and the mesh should follow along.

I tried long to find a good general strategy (DatToSop? ChopToSop?) but I didn’t succeed.

If someone could point me in a good direction, it would be awesome.

Best regards! Florian.

hi larifon,

I usually approach these kinds of challenges by starting with a grid SOP, and then think about how I want to modify it. This is usually a little easier than making your grid from scratch.

Take a look here to see how you can modify the values in table1 and see the grid change.
base_change_grid.tox (1006 Bytes)

Hi Matt,

thanks! In the meantime I arrived at using a noise texture, convert it (TopToChop), sequence the channels (ShuffleChop) and use a MathChop to add them onto the channels coming from a SopToChopp’ed GridSop.

I think this wors fine as well, I only need to have more finer/blurred noise from the texture and then resample the channels coming out of the SopToChop, so that the changes in the ChopToSop are not so step-like - right?

Thanks a lot! Best regards

ChopToSop_byTexture.tox (1.45 KB)

Ahh - I clearly didn’t understand what you were after.

You can clean up the smoothness of the movement by changing your TOPs to be 32-bit instead of 8-bit. Is that the effect you’re after?

Hi Matt,

I’ll try. It also helped I increased the amplitude of the noise (before it was 0.01 or sth) and then later multiplied the SopToChop’ed Values by 100.

Thinking about this - is there some way/parameter in TD to define with which precision floats are handled, how many digits after the comma? (I have a VVVV background…)

Another thing, I now use resample to reduce 48576 values coming from the NoiseTop to 3035. Works, but the Interval (48591.6f I guess ?) doesn’t change, so there in my screenshot math1 is actually having such a long line. I can fix that with math1’s align.

Or do I have to set resample’s End to 3035 Samples?

Best!

A couple of things:

I believe that CHOPs are 16 digits without any control on constraining or extending their precision. Textures (TOPs) on their common page can be set to 8, 16, or 32-bit depth under the pixel-format parameter.

Re the resample CHOP - are you just looking to trim your your chop down to a the same number of verts as your SOP? The chopto SOP has a paramter “Mapping” that you can use to “Resample CHOP to Fit SOP.” I think this will save you an operator. In these kinds of applications I’d usually make sure my sampled texture was matched up to my geometry.

Speaking of - are you intending on this being animated? SOPs are currently the slowest part of the TouchDesigner pipeline, so if possible you want to avoid any work that’s going to cause them to change every frame. The more efficient approach for this kind of deformation would be a vertex shader - and you can get there pretty quickly with only a few lines. There’s some reference material here to get you started if you want to see how work with vertex shaders in Touch:
matthewragan.com/make-some-nois … hdesigner/

Hope that helps!
M