-
Positioning 2 cameras
I would be grateful for help with the maths. Although it may be simple, I have spent several hours in confusion. Thank you.
I have an AE camera. It moves Postion and Rotation within the AE’s 3d space.I want to add a 2nd camera which remains a fixed distance away. The two cameras thus behave like the 2 eyes in our heads.
I want an expression to set the position of this 2nd camera.Of course, I can already use:
1) the xy and z Position of 1st camera Camera
2) create some standard maths equationsBut. Despite much head scratching and using pencil and paper, I cannot work out the final equation. Or whether I am even doing it the best way. Thank you in advance.
//(1)
p0= thisComp.layer(“Camera 1”).transform.position[0];
p1= thisComp.layer(“Camera 1”).transform.position[1];
p2= thisComp.layer(“Camera 1”).transform.position[2];
xr=thisComp.layer(“Camera 1”).transform.xRotation;
yr=thisComp.layer(“Camera 1”).transform.yRotation;
zr=thisComp.layer(“Camera 1”).transform.zRotation;//(2)
mp=Math.PI/180;y1=100*Math.sin(xr * mp);
z1=100*Math.cos(xr * mp);x1=100*Math.sin(yr * mp) ;
z2=100*Math.cos(yr * mp) ;x2=100*Math.sin(zr * mp) ;
y2=100*Math.cos(zr * mp) ;//(3)
[p0+?,p1+?,p2+?]