random distributed in 3d

What type of scripts do you need?

Moderator: byronnash

Post Reply
kapetanmilutin
Posts: 1
Joined: December 4th, 2008, 6:21 am

I need my layers random distributed in 3d space all faceing to centre. any sugestions? please help, tnx
kobyg
Posts: 128
Joined: December 7th, 2007, 10:11 am

Add a Null, make it 3D, and position it where you want the center to be (call it "Null 1").
Then apply this expression for the Position of the layers:
(this will place them randomly around the Null, at maximum distance of +/- 200 pixels in [X,Y,Z] from it)

Code: Select all

seedRandom(index,true);
thisComp.layer("Null 1").transform.position + random(-200*[1, 1, 1],200*[1, 1, 1])
And this expression for the Orientation of the layers:
(this will make them orient toward the Null)

Code: Select all

lookAt(position, thisComp.layer("Null 1").transform.position)
Koby.
Post Reply