**[Jason McKee]** *"is it possible to orient a 3d layer between multiple 3d nulls. it seems like there should be a way to orient a 3D layer between 3 nulls."*
Looks like a good feature request for

keen_3dLayerTools [link] [link]!

In the meantime, try these expressions.

Position:

`// applied to the position parameter, this expression computes the triangular centroid of a plane defined by three points`

p1 = thisComp.layer("Null 1").transform.position;

p2 = thisComp.layer("Null 2").transform.position;

p3 = thisComp.layer("Null 3").transform.position;

// the centroid is the average of these points

centroid = div(p1+p2+p3,3);

Orientation:

`// applied to the orientation parameter, this expression looks down the normal of the a plane defined by three points from its centroid`

p1 = thisComp.layer("Null 1").transform.position;

p2 = thisComp.layer("Null 2").transform.position;

p3 = thisComp.layer("Null 3").transform.position;

// the centroid is the average of these points

centroid = div(p1+p2+p3,3);

// the normal vector of a plane is (p2-p1) x (p3-p1)

n = normalize(cross(p2-p1,p3-p1));

// use lookAt to get the orientation necessary to look along the normal vector from the centroid

lookAt(centroid,centroid+n)

Walter Soyka

Designer & Mad Scientist at

Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting

@keenlive [twitter] |

RenderBreak [blog] |

Profile [LinkedIn]