so I got a few nice things going with VVVV but I still have some basic problems regarding spreads. I am pretty experienced in textual programming but there are many things where I just don’t know how to create it in VVVV.
So for a start, just as an exercise, I wanted to create a checkerboard texture using DynamicTexture. How would I do that? Feeding the texture with a linear spread with 0s and 1s? Creating a two-dimensional spread with cross? Does _cross_even return something that is similar to a two dimensional Array?
There are a few other question that may follow, but for now I just want a simple solution for this problem.
hi,
i just did it with 2 I (Spreads), a GetSpread (Spreads) and a GetSlice (Spreads).
i first created the even and the uneven row and simply selected them afterwards with getslice and a binsize of the column count. i can give you the patch if you want to…
@Elias: Can you upload the patch? I tried to do it your way but I don’t quite understand how to use GetSpread and GetSlice to choose between the two ISpreads. BTW: What is the difference between GetSlice with a bin size of 3 and GetSpread with a count of 3?
@tonfilm: thanks, i tried it your way too, but i didn’t know about the filter-node!
Okay, so my next question would be: How do I draw a circle in a texture?
First thought would be to use CircularSpread. But how do I convert the X and the Y to one value again to connect it to the DynamicTexture?!
you could use the circularspread outputs to build your indicies
you’ll get gaps / overpopulation though as your spreadcount needs to exactly match the amount of pixels whilst having the same dispersion as them.
anyway, you’ll instantly see what i mean when you do:
p.s. i’m having trouble thinking of a situation where you might ever want to do that.
other (more stable but performance intensive) method is:
use points2vector to find the radius of a point B from point A
set point A to be center of your circle
input all the pixel positions as point B
then you’ll have a spread of all the disances of B from A
for a circle, you want to draw a locus around A, such that the radii are equal.
so compare the radius’ that come out of points2vector against a constant radius using the ‘= (Value)’ node. Use the ‘Epsilon’ to give thickness to your circle’s line. By default this will be 0, so you’ll need to increase it.
You’d be best looking at GDI renderer help patches if you want to draw circles in that way.
But i think you’re just trying to learn spread maths?
Thanks sugokuGENKI, I tried to program the other solution you described. But it doesn’t work. Seems like the Index Values are wrong. Could you take a look at this patch?
There is no particular reason why I need to use DynamicTexture. I think it’s just a good excercise because I have some other problems related to my misunderstanding of spreads.
I think the next good excercise would be a “game of life” texture. ;)