====== Recording panorama videos ======
^ Author | [[user>Aaron]] |
^ Last updated | 22 Feb 2008 |
This tutorial will explain how to record 360-degree panoramic videos of your terrain using the //[[plugins:Sapphire]]// and //[[plugins:fileio:L3DTio_VFW]]// plugins. An example video is given below:
^ A panorama recorded from //Sapphire// ^
|
|
| [[http://www.bundysoft.com/L3DT/downloads/examples/output6_transcode.avi|Download AVI]] [1.4MB; better quality than YouTube] |
===== Installing required components =====
==== L3DT version ====
This tutorial requires [[bundynews>l3dt:ann:v2.7|L3DT release 2.7]] (Feb 2009) or later, in any edition ('Standard', 'Professional' or 'Pro for Torque'). If you do not have L3DT v2.7 or later, please [[http://www.bundysoft.com/L3DT/downloads/|download it now]]. We'll wait for you...
==== Video for Windows plugin ====
Before you can record AVIs with L3DT, you have to download and install the Video for Windows (VFW) plugin ([[http://www.bundysoft.com/L3DT/downloads/plugins/bin/L3DTio_VFW-bin.zip|link here]]). Plugin installation instructions are [[bundydocs>l3dt:userguide:extensions:install|available here]].
===== Setting up Sapphire =====
Before you record a panorama, you should open //Sapphire// and set up your desired camera position and other rendering settings. To do this, open your project in L3DT and press the '3D' button on the toolbar to open //Sapphire//.
==== Setting the camera position ====
Position the camera in //Sapphire// using the following controls:
^ Control ^ What it does ^
| W key | Move forward |
| A key | Move left |
| S key | Move backwards |
| D key | Move right |
| E key | Move upwards |
| R key | Move downwards |
To rotate the camera, left-click and drag the mouse.
When you run the panorama script later, it will start recording at your current camera position and heading.
==== Other rendering settings ====
Now is a good time to choose the frame size of the output video. To do this, simply re-size the //Sapphire// window.
For better visual results, you may want to increase the triangle count per frame. To do this, use the '0' button or press the 'Tris +'
toolbar button in //Sapphire//.
You may also wish to increase the viewing distance. To do this, press the '=' (or '+') key or the 'Clip +' toolbar button in //Sapphire//.
If you would like to hide the head-up display text in the top-left corner of the //Sapphire// window, un-check the '//Options->Show HUD//' menu option in //Sapphire//.
==== Pause, but DO NOT CLOSE Sapphire! ====
Once you have setup //Sapphire// with your preferred camera position and display settings, press the pause button in //Sapphire//. This is actually quite important, as //Sapphire// consumes a lot of CPU time and will make the rest of the L3DT user-interface quite unresponsive. Hence, I'm going to re-iterate my point for the sake of those not really paying attention:
Remember to pause //Sapphire// once you're happy with the camera position and rendering settings!
If you leave the //Sapphire// window open, the script will record its panorama from the current camera position. However, if you close //Sapphire// before running the script, it will lose your camera position and instead record its panorama from the centre of the map. Thus, I recommend:
DO __NOT__ CLOSE //SAPPHIRE// YET!
===== Running the script =====
To run the script, select the '//Scripts->More scripts...//' item in the L3DT menu. From the list of scripts, select the 'SapphirePanoramaAVI' option and press OK.
The script will then ask you for some settings, as shown below:
{{ :tutorials:l3dt:panorama:panoramasettings.png |:tutorials:l3dt:panorama:panoramasettings.png}}
These settings are:
^ Setting ^ What it does ^
^ PositionX | The east-west position of the camera, measured from the west (left) edge of the map, in pixel units. |
^ PositionY | The north-south position of the camera, measured from the north (top) edge of the map, in pixel units. |
^ Heading | The azimuth/heading angle of the camera, measured clockwise from north, in degree units. |
^ Altitude | The height of the camera above sea-level, in metre units. |
^ nFrames | The number of frames to record in the panorama. |
Once you click OK, the script will ask you for the output AVI filename:
{{ :tutorials:l3dt:panorama:panoramafilepicker.png |:tutorials:l3dt:panorama:panoramafilepicker.png}}
After you select the filename and click OK, the script will begin rendering and recording frames. L3DT/Sapphire will be unresponsive during the movie capture, so it's a good idea to leave it alone until finished. Sit back and enjoy the show...
===== Video compression =====
The panorama script above uses the Cinepak video codec ('CVID'), which is fast but does not have as high a compression rate as more modern codecs. To compress the files further, I suggest you use the [[http://www.videolan.org/vlc/|VLC Media Player]] to transcode the AVI to a format such as MPEG/H264 or MP4/DivX. This may decrease the file size by as much as a factor of 10.
===== Questions or comments? =====
If you have any questions or comments about this tutorial, please drop me a line in [[http://www.bundysoft.com/phpBB2/viewtopic.php?p=5768#5768|this forum thread]].