## [jit.bfg] grid generation

Jan 14, 2011 at 11:43am

# [jit.bfg] grid generation

I’m trying to figure out how jit.bgf’s scale, offset and origin control the grid generation and keep failing.

Scale I understand – the larger its absolute value, the larger is grid’s coverage and negative values make the grid go in an opposite direction.

but offset and origin I don’t undestand. I use “distance.euclidean” in 2D as my test function. It looks like a grey gradient circle with black center. So the black center corresponds to a point the distance to which is calculated at each grid point. To get this at origin of the matrix I have to give the jit.bfg something like (offset -4.33 -4.33). Why? Or I can set the offset to (0,0) and send (origin -4.33 -4.33). It’s as if for distance function offset and origin were the same. I can almost understand that but still, where that magic -4.33 comes from?

But even more confusing – if I want to center the gradient circle in a matrix offset / origin that is necessary depends on scale.

So, how is the grid calculated? Should I just generate the grid myself if I want to have precise control over it (as opposed to generating noise textures, where exact displacement doesn’t matter that much). (Rationale: I want to use jit.bfg for math, that’s why I need to understand what it does exactly).

#54411
Jan 14, 2011 at 12:37pm

I generated the grid with jit.gridcoord with exactly the same result. So the question becomes why [jit.bfg @basis euclidean] calculates distance to (-4.33 -4.33)?

#195990
Jan 14, 2011 at 12:52pm

got it. center (the point distance to which is calculated) depends on random seed (i.e. it is a random point). I guess I have to go a different route.

#195991

You must be logged in to reply to this topic.