reference about jit.expr

Jan 30, 2010 at 8:01pm

reference about jit.expr

Hi all.
I have a lot of questions about jit.expr (like how to map a char matrix to values from -10 to 10 for instance, how does work the beautiful Andrew Benson’s shatter patch to generate this kind of grid with this texture, like what isthe purpose of “%” in: jit.expr @expr “(cell[0]%4.>0.)*(cell[0]%4.<3.)"…

Anyway I would like to know if there was some detailed docs about this amazing object ?


Feb 1, 2010 at 7:21pm

“%” is a common modulo operator. In this case, we’re feeding cell[0] (the x-dimension coordinate of the cell) through a %4 to create a repeating 0-3 sequence across the x-axis of the matrix. The rest of the math there is just a complicated way of creating a {0,1,1,0} sequence across the x-dimension of the matrix. You would probably be well-served to look at a reference for writing mathematical expressions in C. If you have more specific questions, ask away.

Feb 2, 2010 at 12:27pm

As always, THANK YOU Andrew !
I’m going to check mathematical expressions in C.
Bien à toi !


You must be logged in to reply to this topic.