Animating cameras in 3ds Max and exporting to COLLADA format

In this tutorial, I show you how to animate a camera inside 3ds Max and export it to Vanda Engine.

Download fishingBoat.zip file from the model bank and extract it. Now navigate to 3dsMax / Tutorial 1 folder and open boat_fishing.max file.

Setting the animation time

I like to assign a 40 seconds animation to the camera. Assuming that each second contains 30 frams, I should create 1200 keyframs (30*40). Hit the Time Configuration button and in End Time tab, enter 1200.

3dsMax3_set_keyframes

Creating the path and camera

Hit alt+w on the Top view window to maximize it. Switch to the Splines panel and click the Circle button. Click and drag on the viewport to create a smooth, curved line.

3dsMax3_Circle_button

Hit alt+w  to active all view windows. Now use the Topm Front and Perspective view windows to move the circle above the boat. Now create a free camera. To do this, go to Create | Cameras | Free Camera menu. Click left mouse button on Perspective viewport to create one free camera.

3dsMax3_create_path_camera

The Path and look at Constraints

Now switch over to the Motion tab, roll-out the Assign Controller menu and select Position:XYZ. Click the Assign Controller button, select the Path Constraint option from the pop-up window and click OK.

3dsMax3_path_constraint

Roll-in the Assign Controller menu, roll-out the PRS Parameters menu, make sure that Position button is selected. Now roll-out Path Parameters, hit Add path and then H key to open the Pick Object dialog. Now click the circle you’ve created earlier. You can now play the animation.

3dsMax3_Add_path

Look At Target

Now we should specify the target of our camera. Roll-out the Assign Controller menu and select Rotation: Euler XYZ. Click the Assign Controller button, select the LookAt Constraint option from the pop-up window and click OK.

3dsMax3_lookat_constraint

Roll-in the Assign Controller menu, roll-out the PRS Parameters menu, make sure that Rotation button is selected. Now roll-out LookAt Constraint, hit Add LookAt Target and then H key to open the Pick Object dialog. Now click the ship name (_null_) and press OK.

3dsMax3_add_lookat

Assigning the camera direction

In Select LookAt Axis, check X and Flipe. In Upnode Control, check LookAt, and in Source Axis, check Y and Flip.

3dsMax3_camera_direction

Before exporting the camera, play the animation to make sure everything works as expected.

Exporting

Go to File | Export | Export Selected. In Save As Type, choose OpenCOLLADA, give your file a name and hit Save button. This will open the OpenCOLLADA export dialog.

Our camera has an animation that starts from keyfram 0 and ends in keyframe 1200. Due to that, make sure that Enable Export and Sampling options are selected and Start and End values are 0 and 1200 respectively.

Importing

Run Vanda Engine. Make sure that you are in Prefab Mode (Mode | Prefab). Before you import the dae file, add a _LOD1 post-fix to your file name (for example camera_LOD1.dae). From the main menu of Vanda Engine, choose File | Import | External Scenes…. Locate the DAE file and click Open. Now Vanda Engine should report that new external scene imported successfully.

However, COLLADA cameras are not active by default. You should use Tools | Select Camera… menu to activate your desired camera.

Do it now and in new dialog box that appears, choose the name of your imported camera.

3dsMax3_exported_select_camera

Now your COLLADA camera and its animation is activated. As you see you can’t control its position and direction with your mouse. It’s because COLLADA cameras are read-only and used for cut-scenes of your games.

If you want to activate the default camera of Vanda Engine, simply go to Tools | Select Camera… menu, choose Default Free Camera, and press OK button.

Reference

(c) copyright Zehne Ziba Co., Ltd. For more information, please refer to copyright notice.

adminAnimating cameras in 3ds Max and exporting to COLLADA format