Animation with Keyframes

11 сентября 2012 - Админ

    You can create videos in DIALux with selecting Menu -> File -> Export -> Save 3D Video”. You have to define a camera path and several other parameter (see Making videos in DIALux). If you create a PovRay visualisation after defining the camera path, most of the work for making a PovRay video is done. Load the created *.pov file into the PovRay editor. Make sure, that you use the pvengine.exe in the DIALux subfolder. Look for the green lines in the pov file:

// Right click on next line and select "Copy xxx to Command-Line" to render animation
// +KFI0 +KFF249

    As written in the first line, please make a right click on the line // +KFI0 +KFF249. Depending on the setting of your animation the values for KFI and KFF can differ.

Starting an anmation in PovRay using key frames
    Fig. 464 Starting an anmation in PovRay using key frames

    Making a right click a context menu appears. Select the “Copy xxx to Command Line” command. This is now written into the command line in the top of the PovRay editor. Clicking on run starts the PovRay raytracing. PLEASE KEEP IN MIND: a 10 second movie with 25 FPS (frames per second) has 250 pictures to be calculated. If one picture takes a minute, you will wait 250 minutes or 4 hours and ten minutes
    Animation with the clock parameter
    With POV-Ray also animation of scenes can be created. Up to now only static images with fixed camera position and viewing direction have been made. The following settings are defining camera position and viewing direction:

#declare CAMLOCATION=<1.5,1.7,2.6>;
#declare CAMLOOKAT=<6.4,1.7,-7.6>;

    It is important to know, that X, Y and Z are not the same directions as they are in DIALux. Y and Z are changed, compared with DIALux. With the following command lines you can prepare POV-Ray for creating animations.

Animation settings
    Fig. 465 Animation settings

    The camera will be rotated around the upwards axis. Because of that, we will have a look around the room. Rotate <0,clock*360,0> defines the rotation around the up axis. Remember, Y and Z are exchanged, compared with DIALux. Clock is a counter which is going upwards from 0 to 1. The definition of the clock has to be done in the Ini file of POV-Ray. To do this open the Ini file by clicking on the icon. In this Ini file a section with the correct resolution, anti-aliasing and step width of the clock has to be added. Example:

 [320x240, Animation]  Name
 Width=320  resolution width
 Height=240  resolution height
 Antialias=Off  anti-alias switched off
 Initial_Frame=1  Image to start with
 Final_Frame=25  Image to stop with, defines the number of images
 Initial_Clock=0.0  start value of clock
 Final_Clock=1.0  stop value of clock


    After changing the Ini file, POV-Ray has to be closed and restarted. After the restart of POV-Ray this section can be selected in the top left area of the editor.
    Initial_Frame and Final_Frame define the number of pictures to be rendered. In our example there are 25 pictures. Initial_Clock and Final_Clock should be taken without changing. In Europe there are 25 frames per second in PAL format commonly. A 10 seconds lasting film needs 250 pictures (frames). In our example we create 25 pictures, coded as a PAL movie, it will last 1 second. In the POV file we have added the line rotate <0,clock*360,0>. From “Initial_clock=0” up to “Initial_clock=1” the camera is turned around 360°. POV-Ray creates every 360/25= 14.4 degree a picture. The camera should be turned around its own centre. Therefore it is necessary to translate it into the origin before rotating, otherwise the camera will be rotated around the origin on a circular path. To achieve this you have to enter < translate> then < rotate>> then again < translate camlocation="">.

Camera – Rotation and translation
    Fig. 466 Camera – Rotation and translation

    Each picture will be calculated one after another after clicking on the “Run” icon. Each picture will be saved into the work directory with consecutive numbering. With any animation tool, pictures can be combined to a movie (*.avi, *.mpeg,…) The freeware tool VirtualDub can create such movies in a short time in high quality. http://www.virtualdub.org/index

Рейтинг: 0 Голосов: 0 4430 просмотров
Комментарии (0)