Ok, I have done some more work. Since the idea is to be looking down an infinitely-long vanishing “hallway,” you would theoretically need an infinite amount of data to populate the image. However, in real life, the resolution of the image is limited by the number of LEDs you have. So, the first step is to determine how much data you need to properly fill in colors for an infinitely long hallway. I am only going to deal with the “floor” of the hallway for now, so from now on, I will call it the sidewalk.
Look at my graphic here: http://i.imgur.com/9x4cQg5.png
It is really important to orient yourself with this graphic before we go further. Don’t fuss with the equations on the graphic quite yet. The first thing to understand is that all the data is in the rectangular “matrix” on the lefthand side of the graphic. I am assuming an LED array that is 40 x 40, my matrix is 240 x 40 with each colored block of data being 40 x 40. The rectangular matrix is then tilted downwards towards a vanishing point that is a height h_v above the bottom of the LED grid (h_v = 20 pixels tall in this case).
When you zoom in on the vanishing point, it becomes clear that at some point, all the data is trying to be crammed into just a single LED pixel. There’s no point generating huge amounts of data if you can’t display it, so I arbitrarily made my cutoff to be where a full row of tilted data can only fit in one pixel. That happens at a height in the data matrix of h_r = w_0 * log(w_0) / log(2). Plugging in 40 for w_0, we get that h_r = 212. So, if you have a rectangular matrix of noise data that is 212 rows a 40 columns, you can completely fill the triangle. I happened to make my rectangle 240 x 40 because that was the next even divisor of 40 (so that the matrix is a group of 6 rectangles instead of 5.32 rectangles).
The next step is to ask, “if I am on the n-th row of LEDs in the triangle, which row of rectangle data does that correspond to?” You can map a vanishing path to the data using this important formula: h_r = w_0 / (1 - h_t / h_v). With this equation, you can easily get the row of noise data as a function of the “height” of the triangle.
Finally, you will want to calculate the width of the triangle as a function of the height of the triangle so that you can scale the 40 columns of noise data to however many LEDs wide the triangle is at that particular position: w_t = w_0 * (1 - h_t / h_v)
The slight challenge will be for you to figure out how to average higher density noise matrix data to fit in a certain LED pixel site. For example, you will have lots of situations where a single LED site covers something like 10 columns and rows of noise matrix data; I recommend using HSV colors and averaging the H, S, and V channels in that cluster. If I were doing it, this would be my procedure:
1. Choose a row of LEDs you want to fill with color. Let’s pretend and choose the 10th row for now.
2. The 10th row starts at a height of 9, and ends at a height of 10. So, using h_r = w_0 / (1 - h_t / h_v), and plugging in 40 for w_0 and 20 for h_v, I see that the 10th row of LEDs actually covers rows 73 - 80 (rounded) of the noise data (counting up from the bottom, of course). So, I would then do a column-wise averaging of rows 73 - 80.
3. Now I am left with a single noise data array that is 40 columns wide and represents the column-wise average of rows 73 - 80. I calculate the width of the triangle at the 10th row and find that the triangle is 20 pixels wide there. So, I would take the average of every 2 columns of noise data from the 1 x 40 array, and end up with a 1 x 20 array of data to populate the 10th row of the triangle. Now, this example was pretty easy because the 10th row happens to be 20 wide, and 40/20 is an integer. What if we were on row 6 of the triangle where it is 30 LEDs wide? Well 40/30 is 1.333 or 4/3, so the first LED would be a weighted average of all (3/3) of the 1st column of the noise data, and 1/3 of the 2nd column. Then the second LED would be a weighted average of 2/3 of the second column and 2/3 of the third column. The 3rd LED would be 1/3 of the third column and 3/3 of the forth column, and so on.
I hope this helps.