cell coordinates in N-dimensional / N-plane count matrix with gen

May 30, 2013 at 8:28am

cell coordinates in N-dimensional / N-plane count matrix with gen

How does gen deal with a 3-D or N-dimensional matrix? In particular, cell counting.

Correct me if I’m wrong but :

in.x gets the value at the current cell on plane 0

cell.x and cell.y gets what cell number you’re at

How do you get cell.z ? cell , snorm and norm all seem to not work at cell.z , I’ve got some isosurface data and I need to know where I’m at within it.

Syntactically, why can’t we use cell.0 cell.1 cell.2 for three dimensional matrices? Why can’t we use in.0 in.1 ect for plane counts?

what is this business of swiz(foo, 0); why not foo.0

The documentation of Gen Overview, in Jitter Gen Objects says “. The swiz operator can take named arguments using the letters r , g , b , a , as well as x , y , z , w in addition to numeric indices starting at 0.” which is misleading because this does not apply to the codebox. Perhaps it should be clarified.

Also gen doesn’t seem to prevent divide by zero where as jit.expr does , I didn’t find that in the documentation anywhere and ran into it debugging while converting jit.expr objects into gen for performance reasons

Attachments:
  1. gen_test.maxpat
#251221
Sep 4, 2013 at 6:53am

Hello,
Try this into the code from [jit.gen]

out1 = vec(snorm.in1.r,snorm.in1.g,snorm.in1.b);

I think this is what you are asking, but my english is bad.

#264226

You must be logged in to reply to this topic.