  | | | Camera/Aspect ratio condundrum | Camera/Aspect ratio condundrum 2003-12-14 - By Joe Spadaro
Back Steve, Gary's post should totally solve your problem.... and you asked for an explanation though, and it involve some standard Trig so here goes...
The reason is that the angleOfView changes is that angelOfView is calculated based on Horizontal or Vertical focal length calculation. You have full control over the choice using the filmFit Attribute. You also have control over this calculation using the cameraBack size since these are the values used for Maya's internal camera AOV calculations.
You can find variations these formulas (for different purposes) in any good photography book or web site. Here is a standard AOV formula:
Angle of view = 2* arctan (FL / D)/2
Where arctan is inverse tangent FL is focal length D is the is the Film Aperture (cameraBack Vertical or Horizontal). The reason for dividing and multiplying is that we must calculate the half-angle and double it for the full angle of view.
Of course the inverse of this formula can be used for determining the focal length of lens needed for a particular angle of view. We had a case where we needed to find the inverse formula to drive focalLength from physical objects in a Maya scene.
The formula I used is as follows:
FL = 2* tan(A/2) * D
Where A is the desired angle and D is the Film Aperture (cameraBack)
One way I have used this formula in Maya is to drive focalLength with physical objects using the following expression:
//Focal Length Expression//
float $focal = tan (0.00872665 * $PhysAngle); cameraShape1.focalLength = (0.5 * cameraShape1.horizontalFilmAperture) / ($focal * 0.03937));
//EndExpression
In this case I divided the camera back in half instead of squaring the Angle, same idea. I am not sure why I had to use multiplication offsets it was probably due to the units Maya uses to determine cameraBack vs world space.
In this case we needed to constrain the camera focal length to follow and include physical objects. For the most situations the Maya Camera performs similar operations based on standard photographic formulas that perform triangulation calculations (Trig). These internal Maya camera formulas establishing the correct relationship between camera back, focal length and angle of view. In your case the difference between using the horizontal and Vertical filmFit settings will totally do the job.
Pay It Forward...
-- Joe Spadaro Shiny Red Guitar Studios http://www.shinyredguitar.com
>-- ---- ---- ---- ---- ---- -- > >From: "Steve Davy" <steviedavy@(protected)> >Subject: Camera/Aspect ratio condundrum >Date: Fri, 12 Dec 2003 19:30:43 -0800 > >Further to the couple of posts about this last week, I'd like to restart >this thread, concerning the change in framing that occurs when you change >the aspect ratio in your render globals. > >I've never understood why going from 4:3 to 16:9 changes the vertical (i.e. >in image space the Y) size of your framing, rather than maintaining this and >simply adding extra area to the sides. Can someone at least explain to me >why Maya does this? If I understood the reasoning behind it it might not bug >me so much. > >We're now facing a situation here where we have a couple of hundred shots >that were all framed for 4:3 that now have to go to 16:9, with very little >planning for this (don't ask). We want, where possible, to maintain the >vertical framing and simply add to the edges of the image, as described >above. > >There appear to be only two ways to do this: > >1) Change the camera focal length, however the directors do not want this > >2) Physically move the camera in 3D space. > >The problem with the latter is that any rotation on the camera STILL causes >the framing to be slightly different, due to a different position in space >and a different lookat point. > >Of course we can eyeball every shot, or I'm sure I could come up with some >ways to automate it using an offset of some kind, at least on the >translation. > >But can anyone suggest anything better? > > >Steve Davy >3D Hack > >__ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ __ >Tired of slow downloads and busy signals? Get a high-speed Internet >connection! Comparison-shop your local high-speed providers here. >https://broadband.msn.com >
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --- List-help: <mailto:listar@(protected)?Subject=help> List-unsubscribe: <http://www.highend3d.com/maya/listserver/> List-subscribe: <http://www.highend3d.com/maya/listserver/> List-archive: <http://www.highend3d.com/maya/archive/>
|
|
 |