Processing Forum
for (int i = 0; i < cols; i++) {
for (int j = 0; j < rows; j++) {
PVector direction = new PVector(x, y);
direction.normalize();
field[i][j] = direction;
}
}
}
To be honest I'm quite at a loss as to how to get all fields to point toward the mouse, but the above code at least changes their direction, though they appear to be using the upper left corner of the window as the origin and the mouse coordinates as the target vector, causing this to happen:
Instead, each one of those "waves" should converge on the mouse coordinates.
Any help would be appreciated!
Example code (I know it's not necessary to reinstantiate in this context):Invalid memory access of location 0x0 eip=0x98d4a4c5
Invalid memory access of location 0x0 eip=0x9893ce57