I am trying to use an algorithm I wrote in Processing to create heighmaps for use in programs like Unity. Is it possible to save an image generated in Processing as a .raw image similar to the way you save an image as a .png or .jpeg? I'm sure I could use some conversion software, but I'd rather cut out as many middlemen as possible.
I've run into a problem and can't think of a creative way around it. I am trying to shift the elements of a 2D array right or left depending on where a user places their cursor. I'm doing this to create the "illusion" of scrolling left and right (respectively). I've handled the shifting of elements to the left rather easily using a for loop, but I'm having trouble shifting to the right.
It's a rather complicated problem to explain, but it has to do with the fact that I currently
have to iterate forward through the array at all times, making shifting to the right difficult (since you usually just reverse the iteration direction). I've attached a link to download the code portion I'm talking about, just because it would take a rather verbose post to explain all the exceptions and reasoning behind the structure of the code.
I'm new to Processing, and I've got a question about colorization.
I'm working on a cellular automata program and has different chars (¢, $, etc.) populate to areas of the screen based on a 2D array that calculates a height map. I colorize the chars using a switch function and the fill() command, but I also want to colorize the "background" of certain char
locations on screen so that a non-background color remains even if the char itself changes. I know that using background(r,g,b) is not acceptable since that changes the entire background, but I'm out of ideas. I've pasted the portions of the code for height, color, and char population below.
Any ideas how to do this? Let me know if you need to see more code, as this wont run on it's own.