Page 1 of 1

random distributed in 3d

Posted: December 4th, 2008, 2:51 pm
by kapetanmilutin
I need my layers random distributed in 3d space all faceing to centre. any sugestions? please help, tnx

Re: random distributed in 3d

Posted: December 7th, 2008, 10:43 am
by kobyg
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.