teaching machines

pinterrm – HW1

February 19, 2015 by . Filed under cs455, postmortems, spring 2015.

I started with creating the Image class and its methods. This part was straightforward and with some test cases and verifying outputs the work was complete.

I then moved onto analyzing the formula to be used as the center point of calculations. I made a list of structs for holding basic information related to the random generated bumps. A few loops was all it took to calculate the proper intensities from the various bumps, which were then mapped to a color gradient based on the intensity and the x,y position of a pixel. The output is shown below with a couple different parameters.

A problem that was encountered during development was I receiving 1.#IND errors from some calculations which would created nice solid black lines across the image. This error can be caused for a couple of a reasons but the main one is divide by zero. I was generating variances with a value of zero which of course is not a good thing for the formula. The error was fixed by simply adding one to every random variance.

hazyNebula coloredRain 4gradient1000bumps