I’ve been at Java programming again. I’ve organized some code into functions and have a whole new system of generating images. Particularly, I have improved my most useful function. I’ll try to include a screenshot here.
This function is the new and improved version of the original chessboard function. It is not limited to zeroes and ones. It supports multiple colors, which in this case are represented by integers. However, theoretically these numbers can be interpreted in any way you would like. For example shades of gray or an indexed palette. This function makes no assumptions about what I or anyone else might do with the array. What those colors are depends entirely on other code which sets up the colors in a palette. I have functions for that though too which are used in combination to make rainbow or grayscale colors.
But that’s not all! It now does more that squares. It has the variables box_width, box_height, and box_depth which are independent of each other. These variables are essential as they allow tell the program when to switch to a new color. For example, if you set the height higher than the width, the rectangles will appear taller than they are wide. I’ll show some example images that have been generated with this function.
So as you can see, I’ve learned a lot more about creating images using Java. However it’s very time consuming and exhausting. I think I’ll take a break for awhile but it’s so rewarding seeing the kinds of things I can make with it.