50000 Rectangles #10
100000 rectangles.
(Continued from 50000 Rectangles #9.) After all of this, the results were underwhelming. Perhaps there was a bug, but I believe the results were accurate. Just not very exciting.
One problem I identified with my method came from using adjacent pixels to compute the normal. Shadows were one pixel wide. The same scene looked different at different resolution. Higher resolution meant thinner shadows. Also at different resolutions, the adjacent pixels are different, so the surface normal calculation gives different results.
To solve this, I choose pixels a certain (resolution-independent) distance from the target pixel to compute the normal. I also used a weighted average of pixels near that target distance rather than a single pixel.
50000 Rectangles #9
100000 rectangles.
It was my intention to create an accurate 3d lighting representation of the surface describe in 50000 Rectangles #8.
I defined a point in space for the eye, and points for one or more light sources. I assigned brightness to the light source, reflectivity to the surface. I added parameters for degrees of diffusion and spot light cone size, and several other things.
For a given pixel I use the pixel to the left and the pixel above to create a triangle in 3D space. Then the surface normal to the triangle is calculated, and from that the angles to the eye and the light.
50000 Rectangles #8
50000 rectangles
If you have not been following along, I described rectangle weight in 50000 Rectangles #2 and pixel weight in 50000 Rectangles #7.
Now we can view the image as a surface in 3D space. The pixel coordinate is x,y, and we use the pixel weight for z, height. We can shine light on the surface and create shadows and reflections.
One could do that. But that is not exactly what I am doing. To be continued…
50000 Rectangles #7
50000 rectangles
I described a rectangle's weight back in 50000 Rectangles #2. This weight could also be considered opacity, or its inverse, transparency.
I keep track of the total weight on each pixel. Each time a rectangle covers a pixel the rectangle weight is added to the pixel weight.
All rectangles, and all pixels covered by each rectangle are assigned the same weight. So the pixel weight is essentially the number of rectangles that intersect the pixel.
Weight varies from image to image, but on a single image it is constant. At least so far. I may experiment with rectangles of different weight, or different pixel weights within a rectangle.
50000 Rectangles #6
50000 rectangles
10000 each of five colors. weight = 5%
I am sure you noticed the black outline or shadows around some of the rectangles, and you suspect there is something else going on. There is. The explanation will take a few days. (I have over 20 of these images to post, and I tend to run out of words before images. So I am spreading the words over many posts.)
50000 Rectangles #4
10000 rectangles
Today we have 10 colors. 1000 rectangles each. The "weight" (as defined in 50000 Rectangles #2) of each rectangle is now 5%. So fewer, and more transparent rectangles than the previous images.
50000 Rectangles #3
20000 rectangles
Today's picture has 20000 rectangles. There are 1000 rectangles each of 20 colors. The rectangles are painted in order of 1000 of the first colors, 1000 of the second and so on. While there is an equal number of rectangles of each color, the color of the last set (in this case orange) dominates.
Textured Scribbles #1
Another short series, Textured Scribbles, starts today. Like Textured Fractals, these started as experiments as part of the Experiment 2023.2 series.
There is a lot of overlap with the previous two series. The textures are borrowed from the Experiment series. The scribbles are contour line from fractals in the Textures Fractals series.