Skip to main content
Participant
September 28, 2022
Question

How to get the real position of a camera's target point via expression or scripting?

  • September 28, 2022
  • 1 reply
  • 312 views

I am working on a project about exporting AE animation data to webpage, when I try to get camera parameters. Normally I can get the coordinate of the 'target point' from the camera directly, but when i rotate the camera, the 'target point' keep moving but the parameters not change, how to get the real position of a camera's target point via expression or scripting?

This topic has been closed for replies.

1 reply

Mylenium
Legend
September 28, 2022

Unless you care for a whole lot of complicated math that re-creates the entire logic as expressions, simply use a two-node camera with a separate Null as the target. There's really no good way to go about it since the relevant matrix functions from the API are not avialable in the expressions. Otherwise you'd have to create a nested construct that converts the rotation to a vector and then you can calculate the world position of the point with toWorldVec() and similar with all the potential caveats like angles flipping around after the Euler conversion.

 

Mylenium

BigxixiAuthor
Participant
September 28, 2022

Thanks for replying Mylenium!
I am trying to recreate the camera (woth other animated layers) in the web, so I may have to do the calculation. Oh no, math:(

Community Expert
September 29, 2022

AE is the wrong tool for creating web-based animations with a camera. You should be using Adobe Autition.