Activity › Forums › Adobe After Effects › Scale vs Postion calculations
-
Scale vs Postion calculations
Posted by Criis Daw on November 9, 2006 at 2:42 pmHI,
Please can anyone tell me the mathamatical relationship between scale and z position……
I want to put the different letters of my logo at different postions in z space but change their scale so they all appear to be at the same depth .. (the fun should come when the camera moves). Whilst i am able to do this very well by eye , it has got me a pondering what is the mathematical relationship between z position and scale.
Does anyone know ?? It might save me lots of time , especially from doing sums, that dont add up, instead of working.Cheers
Love ya
Chris
Criis Daw replied 19 years, 6 months ago 4 Members · 8 Replies -
8 Replies
-
Mylenium
November 9, 2006 at 3:43 pmThere is no relationship in absolute terms. What you actually would need to do is have some fixed points (e.g. the corners of the letter bounding box) and calculate their relation in worldspace compared to the anchorpoint of the layer and the camera, figuring in the cameras zoom and whatnot. I think a while back Dan provided some simple code that would match a 3D layer so it fills the entire comp. If you can dig it out, it may be a place to start. However, unless there is urgent reason to be mathematically precise, matching things by hand might still be a better choice. It will simply look more organic and thus more endearing.
Mylenium
[Pour Myl
-
Sam Moulton
November 11, 2006 at 3:09 pmthe relationship depends on the focal length of the camera. when a layer is the same distance in pixels away from the camera as the zoom value the scale is 100%
-
Criis Daw
November 11, 2006 at 5:39 pmSo if the object was twice the distance of the focal length of the camera away would it need to be scaled by 200% to appear to be ar at normal (100%) size?
-
Steve Roberts
November 11, 2006 at 7:37 pmDrag something into the comp.
Duplicate it.
Make one copy 3D.
Add a camera.
Move that camera 300 pixels away (Z) and set the zoom to 300.
The 3D version and the 2D version should be the same size.Try it with the camera Z pos at 1000 and zoom 1000. Or z at 675 and zoom at 675.
-
Criis Daw
November 11, 2006 at 9:01 pmthank you all for your input….
if i want my objects at different positions in z space the camera wont be able to have the same focal lenght for them all.. Either way , this has thrown up some very interesting posibilities to play with so i thank you all
best wishes
chris
-
Steve Roberts
November 11, 2006 at 10:11 pmWell, if you extrapolate my earlier post, here’s an example setup: (in theory–I haven’t tried it)
Letter A, letter, B, letter C: three layers, all 3D.
Camera is at Z=0 pixels, zoom=200.
Letter A is at 100 pixels, letter B is at 200 pixels, letter 3 is at 400 pixels.
You want them all to appear the same size.
So A has to be scaled to 50%, B to 100%, C to 200%.
If you wanted them to match a half-scaled 2D layer, you’d have to scale them down again by 50% or double their distance away from camera.Now, if your 2D object isn’t scaled to 100%, we need to add something to the equation. Put another way:
a=scale of 2D letter we’re trying to match in %
Z=camera zoom (camera is at Zpos=0)
P=z-position of 3D object
S=scale of 3D object in %Therefore S/100=a/100*P/Z
e.g. for a zoom of 300, a desired Z-position of 150 and a 2D scale of 50%:
S/100=50/100*150/300
(drop the 100’s) S= 50*150/300
S=25 (this is the scale of the 3D object)You could alos insert a desired S and calculate P.
Of course, this assumed that the camera is looking straight along the Z-axis, and that the Z-distances are long enough to avoid too much parallax. If you move things around too much, you’ll need to search for one of Dan’s posts that calculate the distance between objects when things are at an angle, and X- and Y- distances are brought into play.
Hope that helps,
Steve -
Criis Daw
November 12, 2006 at 1:57 pmThat is exactly what i have been trying to work out..
Thank you for doing it for me.. I will have to give it test (its sunday today and my girlfriend is soon going to be pissed off of i dont leave the computer alone !!)
Thanks again, i really appreciate it, Its more complivated than i imagined but I could mentally that the relationship was defined mathematicaly but just could get my head around why the calculations i had tried would work.. I always say I do this job becuse my favourite subjects at school were art and maths …. probably i liked art better thoughCheers Steve (and all you cow peoples )
chris
Reply to this Discussion! Login or Sign Up