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.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.