banner



How To Look Through Camera In Maya

Overview

In this tutorial nosotros go along with the import of the camera sequence from CRYENGINE. The camera nosotros import will not have correct orientation. It will exist looking downwards. Then, in the grade of this turoial section, nosotros volition use the FBX camera transformation and parent a 2nd photographic camera for re-orientation. Finally, we must also change the FOV and other camera settings to friction match the CRYENGINE photographic camera view.


(img00: the finished Maya scene)

Import FBX scene objects and photographic camera

Offset nosotros need to establish our scene. Please import the two exported FBX files from CRYENGINE which holds the scene objects (a tank and a van if you use our tutorial files) and the camera animation.

  • Make certain Maya can read FBX files. In Maya'south main bill of fare bar go toWindows ->Settings/Preferences ->Plug-In Managing director.
    The "fbxmaya.mll" plugin should be checked "Loaded".


(img01: Loading FBX plugin in Maya)

  1. Import the scene objects: Become toFile ->Import in Maya'due south master menu. Browse to the path of the scene objects and import the FBX file.
    Frame the imported objects in your "persp" camera viewport. They are unremarkably non located in Maya's origin.

    (img01a: imported scene geometries)

    Geometries are displayed double sided by default in Maya. Get to the "Shape" node of each geometry and change this behaviour to avert the black and greyness shaded polygons on top of each other.

  2. Get toFile ->Import in Maya's principal menu. Browse to the path of the camera animation FBX file and import it.

    (img01b: MasterCamera node with animation)

  3. You lot should change from "Motion picture" fps to "NTSC" fps, equally CRYENGINE uses thirty fps. Encounter the picture beneath how it is done.

    (img01c: NTSC time setting)
  4. Optional: You can create a large polygonal plane object into the scene to have this as replcaement for the CRYENGINE default terrain object. Translate this plane to roughly make contact to the tires of the "SWAT van".

Re-aligning imported FBX camera

The imported camera has incorrect orientation. We have to re-orient information technology. To achieve this, we adhere a new Maya photographic camera node to the imported "MasterCamera" node and add local ninety° commencement rotation to it.

  1. Create a new Maya camera from Maya's primary menu:Create ->Cameras ->Photographic camera. This is the free camera without an Up and Aim node. Give it  the name "MayaCamera".

    (img02: new Maya photographic camera created)
  2. Zero out the world space transformation data by adding a new group node under the "MasterCamera" object before parenting the child "MayaCamera".
    To do so:
    1. PressCTRL - G key and an empty transform/grouping appears in the Outliner. Rename it to "MayaCamera_Zero".
    2. MMB -click & drag this group under the "MasterCamera".
    3. MMB- click & drag the "MayaCamera" under the "MayaCamera_Zero.
    4. To "cypher out" the transformation of the "MayaCamera_Zero" group node and "MayaCamera"node, go to ChannelBox and zip the Translate and rotate values. Now you run into that the "MayaCamera" and its zero'ed out parent node, are aligned to the CRYENGINE "MasterCamera".

      (img03: How to "Zip out" transformation of a kid node)

      Check the Interpret/Rotate values of the grouping and child camera node separately! If you select each one, they must be located right over the "MasterCamera".

      Next nosotros will rotate the "MayaCamera" locally.

  3. Nosotros demand to switch to a new viewport layout, where we are looking through the "MayaCamera" or you could but switch the agilepersp view to "MayaCamera":

    (img04: "MayaCamera")
  4. With starting time rotation of 90° in 10 and Y axis nosotros should have the correct photographic camera aiming towards our tank and SWAT van. Scrub the timeline to cheque the camera animation. The but thing off is the camera resolution/aspect ratio. This volition stock-still in the next section.

    (img05: Fixed camera orientation)

Converting photographic camera FOV

CRYENGINE camera FOVs are vertical FOV. But standard cameras in Maya are using horizontal FOV. Yous have to convert these values start.

Also, the FOV value from the imported FBX camera ("MasterCamera") is incorrect. Don't employ information technology.

  1. Please select the "MayaCamera" and open the Attribute Editor. The FOV value at that place is not what you might expect to ready FOV for the MayaCamera.

    (img06: FOV value of the FBX "MasterCamera" does not friction match)
  2. You accept to convert the sixty° vertical FOV to horizontal FOV.
    For our instance we accept used these settings in CRYENGINE:
    • FOV (vertical): 60°
    • 640 x 480 pixels (aspect ratio iv:three)
    • 30 fps
    A vertical FOV of 60° in CRYENGINE is roughly 75.1782° horizontal FOV in Maya.
    FOV conversion maths here:
    1. phi_vertical := vertival FOV angle in degrees, eastward.g.60°
      Hpix := resolution height in pixels, e.g. 480
      Wpix := resolution width in pixels, e.g. 640
      dist := distance from object to camera lens
      ( If you but have the attribute ratio,e.g. 1.333, then set Hpix to 1.0 and Wpix to 1.333)
      conversion math:
      tan(phi_vertical / 2) = Hpix / dist
      <=> dist = Hpix / ( ii * tan(phi_vertical / 2) )
      => phi_horizontal = 2 * atan( Wpix / (two * dist) )

    2. For the moment being, please refer to the 3dsMax tutorial section how to convert your vertical FOV value. You may want to re-write the MAXScript function in MEL or Python.
  3. You nonetheless have to modify the camera rendering output to 640 x 480. Come across the screenshot below for the details:

    (img07: Matching the CRYENGINE and Maya camera FOV angles)

You may want to output the camera sequence in CRYENGINE for camera matching in Maya. Please refer to the CRYENGINE docs to render your photographic camera sequence with Rail View.

Source: https://docs.cryengine.com/pages/viewpage.action?pageId=29799718

Posted by: snyderficumard.blogspot.com

0 Response to "How To Look Through Camera In Maya"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel