Groups > Multimedia > Adobe After Effects expressions > Re: Keeping 3D layers oriented upright




Keeping 3D layers oriented upright

Keeping 3D layers oriented upright
Sat, 20 Oct 2007 10:44:52 -070
In this first example, both layers rotate in 3D space like normal.

 <http://photobucket.com>

This second example is using Dan's formula to keep the triangle facing the
camera

fromPoint = thisComp.layer("Camera 1").transform.pointOfInterest;
atPoint = thisComp.layer("Camera 1").transform.position;

lookAt(fromPoint, atPoint);

 <http://photobucket.com>

Looks great, but the triangle still has Z rotation. How to do I keep a layer
always upright as seen in the third example (which was hand keyframed)?

Post Reply
Re: Keeping 3D layers oriented upright
Sat, 20 Oct 2007 13:56:42 -070
Hmmm.... Where did you get the expression? It doesn't look right for this
application. Can't imagine why the camera's POI would show up in there.

Post Reply
Re: Keeping 3D layers oriented upright
Sat, 20 Oct 2007 15:02:56 -070
Post Reply
Re: Keeping 3D layers oriented upright
Sun, 21 Oct 2007 11:58:38 -070
I'm not sure how you're moving your camera but if you want to take a look at
this <http://www.hottek.net/samples/ComplexCameraMove.aep> project you may
get a better idea about how to move the camera in complex paths.

As for your rotation problem I think you want to use this expression on the
triangle layer's orientation property

      angle = toWorld(anchorPoint) - thisComp.activeCamera.toWorld([0,0,0]);
      correction = radiansToDegrees(Math.atan2(angle[0],angle[2]));
       x = value[0];
       y = value [1] + correction;
       z = value[2];

      [x, y, z]

Post Reply
about | contact