How To Keep Target Camera From Rotating In 3ds Max
Overview
Basically, this tutorial is near correcting the imported FBX camera from CRYENGINE Rail View. The imported camera initially is not aiming correctly at the right axes. We have to fix it in the progress of this tutorial. Finally, nosotros must also match the FOV value and other camera settings to the CRYENGINE camera view.
Import FBX scene objects and camera
From the previous tutorial you exported your animated camera and the scene objects to two separate FBX files..
- Kickoff 3dsMax with an empty scene or "Reset" if your 3dsMax is already opened.
- Get the FBX scene objects byMAX ->Import ->Import. Browse to the FBX file with the (non-animated) scene objects and striking open in the File Browse Dialog.
(img01: FBX scene objects imported to 3dsMax) -
Frame the CRYENGINE scene objects in your opened viewport to verify they are all imported correctly into 3dsMax (except the CRYENGINE terrain if yous didn't add a Surface area entity into your level).
Your scene objects are probably floating in a higher place the XY-plane. You may add a 3dsMax Plane object every bit a replacement terrain.
The Abrams tank is missing its tracks subsequently the import. This is due to the fact, that the Abrams tank (a Vehicle entity) consists of two entities, a *.CGA (tank hull) and a *.CHR (tank tracks).
-
Now we need to import the camera animation from the second FBX file. Follow the step two to import this FBX camera animation.
Usually, your file exported from Track View of Sandbox Editor has a "MasterCamera" and whatever additional photographic camera entity you made in CRYENGINE.
Yous will get i photographic camera, named "MasterCamera", whose transformations does non wait correct and a secondhelper node named "Camera1" which as well has your animation data. We will only ready the transformation of the "MasterCamera". This is the primary goal we must attain in the progression of this tutorial:
Re-aligning the imported FBX camera in 3dsMax to match the CRYENGINE camera.
Information technology would be a good assignment, if you too try to fix the transformation of the "Camera1" node. For this you need to add an additional 3dsMaxFree camera (the one without the Target node) and align and link it to the "Camera1" transformation.
(img02: FBX scene objects with imported camera whose orientation does non match the CRYENGINE photographic camera.) - Earlier nosotros move on, nosotros should prepare up a viewport to testify the bodily imported FBX camera. In the moving picture below we configured a Camera viewport beside our
Perspective and an orthogonal viewport. Feel free to arrange any viewport that suits you. Just make sure, you have one viewport camera which is looking through the "MasterCamera".
In the screenshot below, we likewise added a footing plane to the scene which matches roughly the height as was in CRYNEGINE.
(img03: New viewport layout with a MasterCamera viewport and a new ground aeroplane)
( Notice the "MasterCamera" viewport is empty considering information technology is pointing downwards and not to the tank/SWAT van every bit in CRYENGINE)
Re-Align the imported CRYENGINE camera
In this department, nosotros will add aRotation List controller with two Euler_XYZ controllers, 1 which already holds the importd animation and a second which adds some 90° rotational offsets to the "MasterCamera" to its local axes.
- Select the photographic camera named "MasteraCamera".
- Supplant its default "Euler_XYZ" rotation controller by a "Rotation_List" controller. Simply don't delete the one-time "Euler XYZ" which get automatically included into the "Rotation Listing". Information technology holds the imported FBX photographic camera animation.
(img04: Supervene upon the standard Euler XYZ by a more versatile "Rotation Listing" controller) - Add a new "Euler_XYZ" to the "Available" sub-controller of the "Rotation_List".
(img05: Add a new "Euler XYZ" to "Rotation List") - Nosotros renamed the stacked rotation sub-controllers, to give you a ameliorate impression, what controller is for:
(img06: Finished "Rotation List" controller setup earlier nosotros add the cosmetic rotation) - Earlier we beginning the photographic camera rotation, make sure your active rotation controller is the "Offset_Rot" controller.
(img07: Set "Offset_Rot" as active rotation controller)
- Finally we tin add the starting time rotation needed to fix the "MasterCamera" orientation. Delight at present be careful to follow each steps to avoid mistakes:
-
Select the "MasterCamera" in a perspective viewport if not washed already.
- Switch the Rotation Tool by pressing "E" key
-
Switch tolocal coordinate system of the "MasterCamera" past pressing"Alt" central +Right1000ouseButton-Click in your perspective viewport and choose "Local":
Pay attention to be in LOCAL infinite/coordinate organisation when yous add the offset rotation to the camera
- Now we rotate our "MasterCamera" in 90° angles to re-orient until we get a camera perspective that simply demand a correction in FOV/lens and render resolution. We had to rotate the local X and Y in +/- 90° steps.
(img09: Camera orientation fixed)
-
Common Pitfalls:
- You switch to Local coordsysBEFORE y'all're in Rotate Tool ("E" fundamental).
- Think: 3dsMax stores for each Move/Rotate/Calibration Tool ("West", "E", "R" key) its own coordinate system it is transforming. Thus, your Motility Tool may use Screen coordsys, but Rotate Tool is in Local coordsys, while Scale Tool transforms in Globe coordsys.
- Have the wrong sub-controller of your "Rotation List" activated when yous make the offset rotation.
- Apply outset rotation directly onto the original animation data -> Did not make use of a "Rotation List" controller and encapsulate the original blitheness data and corrective rotation starting time in TWO separate sub-controllers.
- Just the first frame of your photographic camera animation is fixed: Scrub the time slider to the last frame and check by eyeballing the results! See 3.
Matching the 3dsMax camera settings to CRYENGINE camera
Now it's fourth dimension for us to set up the "MasterCamera" in 3dsMax to match the CRYENGINE camera viewport. Remember the FOV/FPS/Camera Resolution in Sandbox Editor we fabricated?
- You lot should have both the CRYENGINE scene and 3dsMax scene opened. This makes a lot easier to come across what changes are doing what.
(img10: Prepare CRYENGINE and 3dsMax to exist on ii monitors. Below nosotros can see the finished and matched cameras) -
With your "MasterCamera" selected, go to 3dsMax Modify Console to see the photographic camera parameters we must change.
In club to set the FOV bending for the 3dsMax camera correctly, you must know, that the FOV bending you set in CRYENGINE is measured vertically . Proceed in mind, you should also know the camera output resolution or at least the aspect ratio to go a correct camera match in both CRYENGINE and your target 3D application (Maya, 3dsMax, Cinema4d, Blender, etc)
(img11: Change these 3dsMax photographic camera settings) - We likewise demand to change the camera output resolution to what you lot fix dorsum in CRYENGINE: in our example, it's 640 x 480
(img12: return output of the 3dsMax camera) - You should too check that 3dsMax is in 30 fps, since our animation in CRYENGINE was 240 frames long. The last option you should actuate is,
whenever you have a real camera involved, you actually want to come across the photographic camera frames to match:
(img13: Safety Frame turned on)
- With these photographic camera settings, your output here should match what you created in CRYENGINE.
(img14: Finished and matched cameras in 3dsMax & CRYENGINE)
MAXScript function for FOV conversion
Here is a function you can use to convert the CRYENGINE camera FOV to whatsoever FOV used by other 3d programs:
function ceFn_convertFOV argWidth argHeight argVerticalFOV = ( clearListener() -- convert user input parameters to float values fVertFOVAngleDeg = argVerticalFOV as bladder fWidth = argWidth as bladder fHeight = argHeight as float aspectRatio = undefined fHorFOVAngleDeg = undefined iConversionCase = 1 -- FOV conversion calculations try ( -- calculate aspect ratio by given pixel width and height of the photographic camera resolution aspectRatio = fWidth / fHeight format "\nAspect ratio: %\northward" aspectRatio case (iConversionCase) of ( 1: -- example one: convert vertical to horizontal FOV ( fDistance1 = fHeight / (two.0 * tan(fVertFOVAngleDeg / 2.0)) format "\nDistance: %\due north" fDistance1 res1 = 2.0 * atan (fWidth / (2.0 * fDistance1)) format "\nconverted horizontal FOV: % \n" res1 fHorFOVAngleDeg = res1 -- instance 2: catechumen horizontal dorsum to vertical FOV for testing the correctness fDistance2 = fWidth / (2.0 * tan(fHorFOVAngleDeg / 2.0)) format "\nDistance: %\due north" fDistance2 res2 = 2.0 * ( atan ( fHeight / (2.0 * fDistance2) )) format "\nconverted vertical FOV: % \n" res2 -- example 3: convert vertical FOV to diagonal FOV fDistance3 = fHeight / (2.0 * tan(fVertFOVAngleDeg / 2.0)) format "\nDistance: %\north" fDistance3 fDiagonal = sqrt( (pw fWidth 2) + (prisoner of war fHeight 2) ) res3 = 2.0 * ( atan (( fDiagonal / (2.0 * fDistance3) )) ) format "\nconverted diagonal FOV: % " res3 ) ) ) catch ( messageBox "Exception thrown by ceFn_convertFOV()" ) ) -- case part call for a resolution of 640 10 480 pixels and a vertical FOV of threescore° as used by CRYENGINE Sandbox Editor ceFn_convertFOV 640 480 60
Source: https://docs.cryengine.com/pages/viewpage.action?pageId=29799716
Posted by: leeholoy1948.blogspot.com

0 Response to "How To Keep Target Camera From Rotating In 3ds Max"
Post a Comment