Position objects in an array - easily?

jd's picture

Hello gang! I have a comp where I am trying to arrange 3d objects (spheres/cubes/etc.) in circles/grids/globes and such in physical space.

Being the math-impaired individual I am I ask: Has anyone made any helper comps for generating position data in patterns like i mentioned? Grids, circles, spheres, cubes, etc. etc. Is simple math for those who get it, but for me is like capers, still doesn't make sense to me. This seems to scream iterators, have looked thru a bunch in the Kineme forums, but still hoping for gold..

Example: I have 20 spheres in a circle, I have laboriously placed them in a nice sexy circle pattern, and now I want to contract the circle and would rather not spend an afternoon at it and then change my mind. Or maybe change to 14 spheres in a circle... that kind of thing.

cheers! jd

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Serious Cyrus's picture
Re: Position objects in an array - easily?

You'll probably have to scrap your placed circles, you could put it all in a 3d transform patch snd scale, which would contract and grow the circle, but that would also change the scale of the objects themselves.

Another easy way to do it is with the replicate in space patch, similar to an iterator, but has a fairly easy way to do what you want, using origins and final positions. Here's a quick patch I did with a cube to make a circle pattern, you can change how many elements with the copies input splitter, this also works out the final rotation with a bit of math. Also change the radius with a published input inside the replicate in space patch.

For a grid, you'd use 2 nested replicate in space patches, use one to build rows, then another to replicate those rows into columns.

Replicate in space doesn't seem to work with the circle patch though.... On the plus side, shadows work with replicate in space, butnot in an iterator.

When using repeating patterns, iterators are the first stop, don't start working out the coords by hand for each instance, you'll only run into grief later, as you've found. There are usually different techniques required depending on how you want your final composition to act. Whatever, when you find you want to place more than one object in any sort of pattern, immediately start thinking about how you could do it with math and an iterator. I'm in the same boat as you, relearning my math. Keep a pen and paper handy, and find a good source of math info, Wikipeadia is pretty useful to find the general concept, but then I find I'm looking at math tutor sites to explain what's going on in simpler terms that I can understand.

Javascript is another option to create coords in a structure, then use an iterator to just go through the structure. There's prob loads of examples around.

PreviewAttachmentSize
Simple Replicate in Space.qtz6.01 KB

jd's picture
Re: Position objects in an array - easily?

THAT does me dandy!! I can kluge from there. U rock. thanks! jd