Make a grid of planes fill camera view I'm making a layout tool for video editing.
How can most efficiently fill the camera view with a series of white planes with even spacing?
I want to have a variable (arbitrary) number of planes, with the gap either -remaining the same or -varying based on number of planes.

Currently I have a:


Plane object (that I can scale)
Curve object to spread an array


Here is the sort of result I need, but there's a lot of manual filling to get it evenly spaced.



Here is the modifier setup I used.



Update

I have accepted the answer by @leander but wanted to add a color solution for the faces. I am driving the unique colors from the segment number of the array. Then I put that through an array with up to 7 unique colors (its a non-variable limitation), using the Window X coordinates.
I wish that there was an easy way to define the Ramp Locations by variable.



Update 2

After using the above solution, I also discovered that I could just add a single large plane then use a brick texture to place a series of box objects across the screen.
Just like Blender Sushi Guy demonstrated with nodes, the same math can be done with driver expressions.



Add a driver to the Constant offset off an array modifier.

Add a driver to the scale (or position) of the stripes.

Create an empty to control the stripes.

To have one less variable, I set the camera as orthographic with a width of 10.

no       number of bars
gap      size of gap between bars
width    width of bars
10       total width


Fixed gap size, varying stripe width

We need to set the width, and the position of the first stripe, based on the number of stripes and the gap size.

Size (X)

(no + 1) * gap + no * width = 10

width = (10 - (no + 1) * gap) / no


Constant Offset (X)

(We have to divide through the width, since the modifier bases its offset on the width.)

[(10 - gap) / no] / width = offset
[(10 - gap) / no] / [(10 - (no + 1) * gap) / no] = offset
[(10 - gap) / no] * [no / (10 - (no + 1) * gap)] = offset
(10 - gap) / (10 - (no + 1) * gap) = offset




Fixed stripe size, varying gap width

We need to set the gap size, and the position of the first stripe, based on the number of stripes and the width of the stripes.

Location (X)

(no + 1) * gap + no * width = 10

gap = (10 - (no * width)) / (no + 1)


Constant Offset (X)

[(10 - gap) / no] / width = offset
(10 - gap) / (no * width) = offset
(10 - (10 - (no * width)) / (no + 1)) / (no * width) = offset