4
$\begingroup$

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:

  1. Plane object (that I can scale)
  2. 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.

Desired Result

Here is the modifier setup I used.

modifers for array

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.

Unique colors per face

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.

material only version of boxes

$\endgroup$
7
$\begingroup$

Just like Blender Sushi Guy demonstrated with nodes, the same math can be done with driver expressions.

stripes with varying parameters

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

| improve this answer | |
$\endgroup$
  • $\begingroup$ Winner winner! Thank you very much that's soooo much more elegant than mine, and it works great. And I awarded the win as it doesn't require any addons to work. $\endgroup$ – 3pointedit Nov 28 '17 at 2:41
  • $\begingroup$ I like this, I will study... and node it. $\endgroup$ – Blender Sushi Guy Nov 28 '17 at 3:30
3
$\begingroup$

If you want solution with Add-On, I am using Sverchok nodes to get this kind of stripes pattern:

https://github.com/enzyme69/blendersushi/issues/201

enter image description here

enter image description here

But with some math, I am sure that Compositor or Nodes Cycles can generate Stripes with Alpha that simply confirm to the Camera View...

| improve this answer | |
$\endgroup$
2
$\begingroup$

Cycles Stripes? Also not the most correct...

enter image description here

| improve this answer | |
$\endgroup$
  • $\begingroup$ I tried this first as well but you get a partial plane at the edge of the screen. Thanks tho ;-) $\endgroup$ – 3pointedit Nov 28 '17 at 2:36
  • 1
    $\begingroup$ Also i used Brick texture :D $\endgroup$ – 3pointedit Nov 28 '17 at 2:37
  • $\begingroup$ Aah.. yes Brick Texture that's kind of doing this. There is some algorithm involved to get it perfectly, but it's there. $\endgroup$ – Blender Sushi Guy Dec 2 '17 at 23:04
  • $\begingroup$ Can you get screen width to use on a texture to limit width and therefore divide by that for number of stripes? $\endgroup$ – 3pointedit Dec 3 '17 at 3:17
2
$\begingroup$

I kind of like this method, basically finding most left and most right of camera view, and then draw stripes in between...

enter image description here

| improve this answer | |
$\endgroup$
2
$\begingroup$

enter image description here

I thought my answer will be short but it grew to full tutorial.

Here is the preview of the result:

https://youtu.be/pvxXx0uMQwY

Here is the link to the tutorial that includes blend files for the impatient.

http://curiousblends.blogspot.bg/2017/11/create-array-of-planes-that-fit-inside.html

Basically you can achieve the result you want using only Custom properties and drivers without the need of add-ons.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.