Forums > Jitter

finally, another recipe

October 31, 2006 | 12:28 am

Hey all,
It’s been a long time coming, but a new Jitter Recipe has been added to
Jitter Recipes: Book 3–

http://www.cycling74.com/story/2006/2/17/153427/406

36.TinyVideo – a patch that demonstrates an efficient method of creating
animated sprite-quads by loading a single texture with a series of frames.

Bon Apetit!

Andrew B.


November 2, 2006 | 8:13 am

Dear all.

I saw no comments on this patch, but I have to say this it is art
coding (again). I would have expect a rave of pure enthusiasm…

I considered myself as a senior coder, but I think I should go back
to primary school compared to guys like Andrew. This is elegant,
fabulously efficient code, and so simple (yet so parallel-thought)
that I blemish of my little example which did this kind of stuff
posted 2 months ago, grossly using hundreds of upcode to do what is
achieved in 4 here.

I bow very low to Andrew’s generosity: today, I’ve learn something
again! (actually, 2: some parallel-thinking stuff, and some humility)

pa


December 9, 2006 | 11:22 pm

i bow even lower
there are some in here that look at the matrice as a way of math thinking.
it is very hard for me still, i have gone thru a lot of code posted on the
list, especially helpful i found Wes example for his line2quad object. but
the cell0 stuff is still forgain to me.
in the help file are only examples of creating "clouds and ramps" but i feel
no depth.
do i need a book?degree?
explanation for the expression used to generate the texture mapping in
tinyvideo?

On 11/2/06, Pierre Alexandre Tremblay

wrote:
>
> Dear all.
>
> I saw no comments on this patch, but I have to say this it is art
> coding (again). I would have expect a rave of pure enthusiasm…
>
> I considered myself as a senior coder, but I think I should go back
> to primary school compared to guys like Andrew. This is elegant,
> fabulously efficient code, and so simple (yet so parallel-thought)
> that I blemish of my little example which did this kind of stuff
> posted 2 months ago, grossly using hundreds of upcode to do what is
> achieved in 4 here.
>
> I bow very low to Andrew’s generosity: today, I’ve learn something
> again! (actually, 2: some parallel-thinking stuff, and some humility)
>
> pa
>


December 10, 2006 | 1:56 am

cell[0] just gives you the number of the cell across the row. In the
patch, the expression using cell[0] etc. is mapping out values
according to cell coordinates. In this case the first 3 planes of the
expression are providing offsets to the quad coordinates. The’s
another expression: jit.expr @expr "snorm[0]" "snorm[1]*0.75" 0. which
generates a grid of points from [-1, -0.75] to [1, 0.75] which are
subsequently offset of the expr mentioned above. The last 2 planes of
the equation setup texture coordinates.

Picking apart patches as compact as this one is not easy because a
months+ work and thought have gone into the structure of it and it’s
most likely going to be way different than anyone else’s eay of
thinking about the problem. You just have to be very methodical and
take your time because it’s not going to come right away with
non-trivial patches like this. The way I approach analyzing patches
it to pull out a pencil and paper and start at the source of the patch
where data enters the system. I then go through each step and figure
out what happens to the data there. What you want to figure out is
the purpose of the transformations at each step, so how do input
values map to output values. Once you’ve notated a few of the steps,
you’ll start to see the larger process at play and things will make
more sense. If you don’t understand a step, take it and make a test
patch with it. Break it apart and rebuild it for yourself until you
understand it. It’s the only way you’re going to learn. For the
expression stuff, start with one part of the equation and slowly
reconstruct it. This will help you see how the values are
transformed. For example, the expressions
"(cell[0]%4.>0.)*(cell[0]%4.<3.)*0.2-0.1" can be broken into 8 parts.
Start with "cell[0]" , then apply %4 to it. Then threshold it at 0,
then do the same with "(cell[0]%4.<3.)" and mutiply it with the other
cell[0] part, then offset and scale the result. Hope this helps and
gives you a strategy to analyze jitter patches.

best,
wes

On 12/9/06, yair reshef wrote:
> i bow even lower
> there are some in here that look at the matrice as a way of math thinking.
> it is very hard for me still, i have gone thru a lot of code posted on the
> list, especially helpful i found Wes example for his line2quad object. but
> the cell0 stuff is still forgain to me.
> in the help file are only examples of creating "clouds and ramps" but i feel
> no depth.
> do i need a book?degree?
> explanation for the expression used to generate the texture mapping in
> tinyvideo?
>
>
>
> On 11/2/06, Pierre Alexandre Tremblay

wrote:
> > Dear all.
> >
> > I saw no comments on this patch, but I have to say this it is art
> > coding (again). I would have expect a rave of pure enthusiasm…
> >
> > I considered myself as a senior coder, but I think I should go back
> > to primary school compared to guys like Andrew. This is elegant,
> > fabulously efficient code, and so simple (yet so parallel-thought)
> > that I blemish of my little example which did this kind of stuff
> > posted 2 months ago, grossly using hundreds of upcode to do what is
> > achieved in 4 here.
> >
> > I bow very low to Andrew’s generosity: today, I’ve learn something
> > again! (actually, 2: some parallel-thinking stuff, and some humility)
> >
> > pa
> >
>
>
>
>
>


Viewing 4 posts - 1 through 4 (of 4 total)