Spreading apart objects (color math)

gabemott's picture

I will be plugging in OSCeleton but for now, just trying to create the ability for these 5 bars of color to be spread apart revealing black between each bar. So the width of the individual bars wouldn't change, but the bars on the ends would move further out, the bar in the middle stays, and the two other bars increment out revealing equal distant black space between.

I tried adjusting the width but obviously this doesn't do it. It keeps them smooshed together. The point of all this is that when they are touching, halations appear. It looks like the bars are gradients when they are together. When they are spread apart and not touching, they are revealed as the single swatches of color that they are.

In OSCeleton, the user will spread his hands apart moving the bars apart, when at his side or at rest, the bars will line up touching eachother.

This comp was created by adamfenn88 and jersmi. I only tweaked it.

Thanks for any help.

PreviewAttachmentSize
halation_adamfenn28_jersmi.qtz7.97 KB

gabemott's picture
Re: Spreading apart objects (color math)

OK, I got the spreading apart of the bars to work. When you raise your right arm, the spread of the bars is based upon the distance from r_hand to r_hip. I used the macro that dust posted for smooth movement, but it didn't really help.

I need help getting it to be more effective. I just want the bars to be more still. The bars are always unsteady, they need to be still in the middle and on the outside. I tried a conditional patch, but that got worse, it just bounced all around.

Maybe it would be even better to have this based on a gesture- either all separated or all together.

PreviewAttachmentSize
OSC_halation_spread_hipminus.qtz622.53 KB

gtoledo3's picture
Re: Spreading apart objects (color math)

Somewhere here, a fellow made/uploaded a plugin that does the $1 Gesture Recognition Library inside of QC. They made an obj-c based plugin that works pretty darn well for about 75% of the available gestures in the demo. There's a few that are pretty close in shape, so they're harder to deal with.

If you search here, you can probably find that. Also, in that download, there's a javascript implementation; that doesn't work well, go with the plugin based demo.

gabemott's picture
Re: Spreading apart objects (color math)

Thanks. While I still do want to incorporate gestures (and I found the plugin you mentioned), the more important thing for this one was to get the bars to stop shaking around. I put in a conditional and got them to be still when together, so much better. It would still be nice to have them less shaky when they are apart. Right hand out pulls the bars apart.

Then I started adding the left hand - outstretched (dist in X from hip) it controls the hue and the Z position in space controls the saturation. I might take this out just because it might get confusing, but that might be more because it is just unsteady motion...

(This is all tryplex based)

PreviewAttachmentSize
OSC_halation_spread_hipminus_2.qtz625.77 KB

dust's picture
Re: Spreading apart objects (color math)

Sometimes the inertia patch can smooth out motions as well. You would want to set inertia to sample when there is movement of the hand and not sample when movement stops. Your condional should provide you a sample value. Then the smooth patch set to continuos mode sometimes works as well. What that does smooth things out sequentially. Sometimes though if things are to jittery you will get a bouncing kind of effect.