Logic (Hittest - S+H -InsertSlice)

Hey guys,

After Node I decided to work on a touch application that I was doing couple of months ago but I’m stacked in a logic path…probably is something pretty easy but I cant find it…I have 2 issues:

  1. I’m using a hittest and s+h to hold the slice (number) of the spread so I feed it in to the getslice and see my specific picture on the screen… the problem is when I select a slice, S+H outputs the slice (for example number: 9) which is what I want it to do but when I’m not selecting anything it goes back to zero (0)…The thing is that on slice zero (0) I have a picture too…and it’s not working…I basically need when I’m not selecting anything to get it to Nil so when I select slice zero to show my picture…is there a way to do that and still use S+H?

  2. The spread of my hittest is 12…and when i select a slice (which is a picture) I want it to change color…I’ve manage to do that with insertsclice (color) but my problem is that when I select a new slice the color moves to the new slice…I want it to keep the color of the previous slice and add the color to the next slice that will be selected…

I’ve attached the patch (is just a part of the main patch so probably you want see any visuals) but you can see the logic I have and maybe give me the solution to my problem…

Thanks VVVVers

callmenames.v4p (24.9 kB)

Hey

to be 100% honest it’s pretty hard to understand what you are trying to achieve.

Below are a couple of pointers that may help, if not, can you try and make a simplified patch that has an input and does not rely on image files? With a lot of these type of projects it really helps if you can break down each step into small parts and figure out the logic piece by piece.

  1. InsertSlice appears to be messing with the spread count, try using SetSlice instead.

  2. The way you are using HitTest & S+H looks wrong, but I can’t work out what you are trying to achieve. “Point Hit” is the ID of the touch points, I’m pretty sure you don’t want to use it to trigger something (in it’s raw format at least).

If you need to know which picture has been touched you need to know frmo the hittest which on is on 1. Then sift the 1, get the index and setslice with this index the spread of color you input on your spread of photos.

Ok…

I have attached two patches…

first is the problem with the hittest…I’ve tried to make it simple…I have a hittest that loads the pictures on the screen and another one hittest that works as an “exit” button which fades the picture…see the patch attached…the problem is:

I have 4 pictures: 0,1,2,3

when I load number 3 for example s+h outputs 3…as far as good…but when I press the “exit” button picture number 3 will fade but the output of s+h is still 3…which leads us to the conclusion that if I want to load again picture number 3 I can’t because is already outputting 3. The question is how I can change it so when I’m using the “exit” button S+H goes to Nil?

The second part is the SetSlice…I have attached the patch…I think what lecloneur said is already done. my issue is how to I keep the color? and it doesn’t go back to what it was when I click somewhere else…

Thanks

Hittest.v4p (15.7 kB)
SetSlice.v4p (8.0 kB)

You need to use multiflipflop advanced to get the index of the clicked quad coming from the hittest.

hi vasilis!

  1. if either a quad or the close button is hit you need to sample the S+H.
  2. you keep the color by using a framedelay. this behaves like a field. i used a switch to reset colors.

is that your desired behavior?

Hittest.v4p (22.0 kB)
SetSlice_0.v4p (18.7 kB)

Yes gregsn…That’s it

I new it was something simple…I didn’t though about sampling the quad or the close button because I have them in different subpatches on my project…But yes so simple…

Thanks!