Animation Using 4D Interactive Models MVSand EVS-PRO have two distinctly different animation concepts. Our traditional animations consist of a sequence of bitmap images that have been encoded into an animation file (AVI, MPG, or HAV) using one of several different CODECS. This type of animation has some distinct advantages including the ability to include a soundtrack (background music and/or narration) and the animations are playable with a variety of common and (usually) free players. C Tech also offers a second animation concept that we refer to as 4DIM, or Four-Dimensional Interactive Model Animations. The name 4DIM (referring to four dimensions instead of only 3) was chosen because these models represent a 3D scene changing in time (the fourth dimension). Unlike bitmap (image) based animations 4DIMs contain a complete 3D model at each frame of the animation. Each frame can be thought of as a VRML model (though it is not) and has similar functionality. Each frame of the model can be zoomed, panned and rotated as a static 3D model or you can interact with the 4DIM animation as it is playing. The 4DIM Player is offered as a module (Playback_4DIM) in all versions of our software and as a stand-alone application. The 4DIM files (which have a.4d suffix) created by EVS-PRO must be played back in a licensed copy of C Tech software or a licensed 4DIM Player (standalone). 4DIM Files created in MVS automatically contain a password that allows them to be played with a demo player. In other words, 4DIM files created in MVS can be played on free players. 563
C Tech Help System for EVS and MVS 9.8 Open 4D File Let's open a 4DIM model file and interact with the 4DIM Player. The file we'll choose is an extremely simple 4DIM file that has 35 frames. Though it is a very simplistic example, it is also an amazingly small file that is only 30 Kbytes (yes Kbytesnot Mbytes!). To begin, run the stand-alone player or instance the Playback_4DIM module from the File sublibrary. The player window appears in the upper left corner of your desktop. From the 4D Interactive Model Player window, choose the File pull-down menu and select Open. The default folder should be ctech\data\4dim (if you installed to ctech). From this folder select the file thermal.4d It is now time to use the 4D Interactive Model Player. NOTE: IN THE STANDALONE 4DIM PLAYER, you may also open 4D files from Windows Explorer or a browser (e.g. Internet Explorer or Netscape) by clicking (or double clicking) on the files. Furthermore, if you have an open file and choose another in this manner, it will open in the current 4DIM player. This also applies to A4D files discussed in a few more topics. 564
4D Interactive Model Player The module for the player integrated in C Tech software is: The Playback _4DIM module and the stand-alone 4DIM Player are identical in functionality with very minor exceptions. The players include an integrated C Tech Viewer with many of its features. Mouse interactions are nearly identical to the Viewer's. The bottom of the player window includes script controls and more. After loading the file specified in the previous topic, the player's window should look like: Shortcuts There are a few keyboard shortcuts worth noting. These will give you quick control over the player. CTRL-F sets the player to FULL SCREEN mode. This is not equivalent to the maximize button in the upper right corner since this removes the normal borders. With the player as the active window, ESC(ape) exits Full Screen mode CTRL-H toggles the Auto-Hide mode. 565
C Tech Help System for EVS and MVS 9.8 The VCR type buttons on the player panel allows you to run or pause the selected scipt. The function of each button is: Stop: Stop script from playing. Pause: Pause script. Play: The play button will open the Choose 4DIM View window. This window selects the current script to be played by the 4DIM player. There are standard scripts that can be played with every 4DIM or complex scripts that can be created and bundled for specific 4DIM's. If a 4DIM has been paused while playing a script this button will instead resume the playing of the script. Start by hitting the Play button. Select "Play Each Frame" from the Standard Script Library and then select the "Play Script" button. Notice that the animation plays from the beginning to the end only one time. There are options to change this behavior. The Run option menu allows for specifying three different ways of playing the animation: Once displays the script one scene at a time. Cycle will display the script one scene at a time, when the script is complete it will repeat this process. Bounce also displays the script one scene at a time, however, when the script is complete it will then play the scenes in the reverse order. It will continue to bounce until stopped. Change to the Cycle option and Play again. Note now that the animation runs until you Pause or Stop. In this mode it runs from start to finish and then resets to the beginning and runs again. Change to the Bounce option and Play again. In this mode it plays from start to finish and then from finish to start and so on. The Current Frame slider provides a visual display of the current frame, and more importantly provides a direct method of examining each frame. The slider button (moving square) can be dragged forward or backward to advance or retreat the current frame in real time. Now let's control the animation using the slider. You should have noticed that it moved when you play with any of the modes above. Press Stop (or Pause) and "click and hold" on the square moving button on the slider. As you move the slider, the animation responds by displaying the frame that you specify by your motion. You can use the Delay slider to slow down the replay. The slider controls the amount of time between frames in seconds. You can set the amount of time from one-hundredth of a second to two seconds. Now that you know how to play the animation, the real fun begins. 566
File Menu Options The file menu for the Playback 4DIM module and the Standalone 4DIM Player have the following options: Open 4DIM file. Choose 4DIM View sets the current 4DV script or A4D file. These files can have basic operations such as setting a certain view, or stepping through every frame in a 4DIM, or they can be complex animations. Save Screen Capture as Image provides a means to save the image in the 4DIM player window (not the border) at whatever resolution (size) your 4DIM player is at the time. Though you can always create high resolution images with Output_Images, this provides a very quick and easy way to save images that are often adequate resolution. When this option is selected you will be prompted for a file name. Supported file types are Windows.BMP (the most common uncompressed file format) and PNG, the highest compression lossless file format. A confirmation window will pop-up when the file writing is complete. Print Screen Capture provides a means to print the image in the 4DIM player window (not the border) at whatever resolution (size) your 4DIM player is at the time. Though you can always print high resolution images with the Print Editor, this provides a very quick and easy way to save print the contents of the 4DIM player exactly as it appears at a resolution that is often adequate. When this option is chosen, a window (as shown below) will appear. You have the following options: 1. Adding an Image Title and specifying the font type, size and color. 2. Including the date and time 3. Fitting the Image to the Page, in order to have the image scaled to fill out to the margins (and additional buffer for the title). 4. Specifying Margin Size in inches. 5. Stretch Preview Image. This option stretches the preview image to fit the preview window. It is most useful for the preview in the Print Editor where the output resolution may be so large that you cannot see the entire image. It may (probably will) cause distortion of the image aspect ratio during preview, but does not affect the output. 6. The Print button opens a dialog allowing you to specify the printer that you wish to use. You may set additional printer settings such as "Landscape" that will affect the final size and orientation. 567
C Tech Help System for EVS and MVS 9.8 Show 4DIM Info opens a window that lists te 4DIM name, author and notes. This information is stored in the 4DIM during the creation process. 568
Transformations with the Mouse Now that you know how to play the animation, let's interact with itthat is why it is called 4D Interactive Model Player. At every frame of the animation, or while it is playing, you can interact with the model and perform rotations, scaling or translations. The commands to interact with your mouse are: Rotate the model. Move the mouse to a location within the viewer portion of the 4DIM Player's window. Hold down the left mouse button and move the mouse pointer in various directions. The model rotates. NOTE: The best way to understand mouse rotations is to consider the viewer screen as a ball floating in a bowl of water. Where you start with the mouse and where you end (release) determine the angle of and amount of rotation. Zoom in or out on the model. Press the '+' or '-' key on the keyboard. This will zoom in on the model. Alternatively either the middle mouse button on a 3 button mouse can be clicked and dragged to change the zoom level, or a wheel button will also affect the zoom. Move (Translate or Pan) the model. Hold down the right mouse button and drag the object up, down, and around, then center the model. Try interacting with the model when it is paused and running. Note how much more informative it is to interact with the animation while it is playing. There are two other ways to transform (interact with) models. The first one we will try is using the Az-El Panel. 569
C Tech Help System for EVS and MVS 9.8 Transformations with the Az-El Panel The 4DIM Player gives us another more precise way to transform (scale, and rotate) a model: through the Az-El panel. Transform the model with the Azimuth and Elevation Panel Click on Az-El on the 4DIM Player's main menu. The first time you do this the model will snap to a top view. Your screen should look like: 570
The Az-El panel provides the ability to set specific views using a variety of controls. These include: A combined Azimuth dial or button array The panel is arranged with an array of azimuth selection buttons in 15 degree increments around the compass, and a dial for setting any azimuthal location. There is also a type-in box for setting a precise azimuth. An interesting feature is that if you move the dial with your mouse, as you cross North, it will add or subtract 360 degrees from the button values. This is important during animations since rotations crossing north must be properly specified to determine the direction and number of revolutions of your model. An Elevation slider (and type-in) sets the angle of the view from horizontal plane. An elevation value of +90 will result in a view from directly above the object (looking straight down the +Z axis), while an elevation value of -90 will result in a view from directly below the object (looking straight up the -Z axis). For example, a value of +20, provides a view looking at the object from 20 degrees above the horizontal plane. Note that changing any of the settings on the Az-El panel updates the current view immediately. 571
C Tech Help System for EVS and MVS 9.8 A Scale Factor slider (and accompanying type-in) allows the user to specify how much of the Viewer width the object(s) will occupy in the specified perspective view. A Scale Factor of 0.7 will therefore produce a display with the object occupying approximately 70% of the Viewer. Values above 1.0 will generally cause some of the model to be outside of the viewer window. The RNC (Reset-Normalize-Center) button with the tri-color icon in the upper left corner of the panel forces a recentering of the model and sets the view to the current Az-El settings. Furthermore, this button causes the Viewer to RENORMALIZE, which means that it recomputes the internal system wide scale factor required to fit all objects connected to the Viewer into the current view. Please note that the RNC pull-down menu on the Viewer includes a "Top View" option that is equivalent to this button PLUS resetting all Az-El parameters to their default settings. An important feature for creating simple animations and automating viewer manipulations is the Spin toggles and it's associated 'steps' type-in box. The typein specifies the number of degrees to spin the viewer azimuth and the '>' and '<' toggles determine the direction of spin. Use of this functionally essentially activates a loop whereby checking the '>' or '<' toggle increments the viewer azimuth according to the prescribed 'steps' type-in. For example, if you wish to automate views incrementing every 10 degrees with a clockwise rotation, you should type-in 10.0 (steps) and check the '>' toggle. The viewer will automatically step through from the beginning azimuth in 10.0 degree increments, in a clockwise direction. This spin can be stopped (interrupted) at any time by unchecking the '>' toggle. HINT: You may connect an output_images module to the viewer, then check the dynamic toggle to save a frame of each viewer position for use in building an animation. The Perspective toggle turns on Perspective mode. When it is turned on, an additional type-in for FOV appears. Additional settings for perspective are under the Camera editor. FOV (Field of View) sets the camera's included angle when in Perspective mode. The default value of 45 results in a camera with a 45 degree included field of view. The Immediate toggle turns on immediate mode for scale and elevation sliders and the Azimuth dial. In immediate mode the view updates in real time as you move these controls. The Roll type-in and very small dial provide control over the object roll axis. This is a rotation that is not normally used since it causes vertical objects to not be vertical. It can be interesting for some fly-through animations or for unusual circumstances. If you choose a scale of 1.0, an elevation of 25 degrees and an azimuth of 210 degrees you should get something like this: 572
573
C Tech Help System for EVS and MVS 9.8 Play Animation Script Files The A4D file has been superceded by the 4DV file. Although the newer 4DIM players will play A4D files the newer 4DV files are more feature rich and flexible. The author of 4DIM files is encouraged to take advantage of the ability to bundle any number of 4DV files into their 4DIMs and minimize the burden on the end-consumer (user) of the 4DIMs. The best way to appreciate the power of bundled scripts is to play one. Several preset views and animation script files that work with most all 4DIM files are built into the Standard 4DIM Script library. To access them, from the 4D Interactive Model Player window, choose the File pull-down menu and select Choose 4DIM View. On this window there is a radio selector to choose between Standard Library and Bundled Views and Scripts. All 4DIM files will have access to the Standard Library, whereas Bundled scripts are only available if they are created and bundled by the 4DIM author. Select Standard Library and chose Fancy Rotation. Unfortunately it isn't possible to show you in the help what happens, but what you should see is an animation that begins with a TOP view, rotates down to 20 degree elevation, spins around 360 degrees and then returns to the top view. A4D Files: This help discussion is still included for backwards compatibility. From the 4D Interactive Model Player window, choose the File pull-down menu and select Choose 4DIM View. On this window there is a button in the lower right to Play.A4D File. Browse to the.a4d file to select it. If the.a4d file is an older style fly through, once it finishes it leaves the Viewer in a non-standard mode. Attempts to interact with the model will give unexpected results. To reset the Viewer after playing an A4D file, choose Reset After A4D Fly- Through on the RNC pull-down menu. Note: If you have a Multimedia keyboard with Play/Pause and Stop buttons, these will control the 4DIM player during script playback the same as the buttons at the bottom of the player. 574
Explore 4DIM Player's Settings Explore 4DIM Player's Settings menus. The tables and figures below summarize 4DIM Player's settings. Fullscreen [Ctrl+F] toggles the 4DIM viewer into and out of full screen mode. Auto-Hide Controls [Ctrl+H] will toggle the play control and player settings to hide unless the mouse moves over the correct area. Renderer selection (OpenGL or Software). View menu's Advanced Settings provides control over several view-related settings. These include: 1. Renderer Selection of OpenGL or Software 2. Depth Sorting (Software Renderer only) 3. Copy Viewer image to clipboard 4. Viewer Size and Aspect Ratio 5. Background Color (if a locked multi-color background was not used when the 4DIM file was saved) 6. Turn on Timer to test your computer's graphics speed 575
C Tech Help System for EVS and MVS 9.8 The OpenGL renderer is a high performance renderer which is native to the Windows operating system, and is the default option. For most objects, OpenGL rendering provides much faster rendering performance than the software renderer, and is the default setting. However, the Software renderer provides some functionality that the OpenGL renderer does not, and therefore is the desired option for some operations. Specifically, spheres are calculated in the software renderer much more quickly and efficiently then OpenGL which renders a many faceted object. If you are visualizing a large number of spheres you should choose the software rendering option. The other important difference is that the Software Renderer support Depth Sorting when your view has multiple transparent objects. When there are two or more transparent objects in your view, without depth sorting the appearance of which object is in front or behind can be improperly displayed. Properly displaying multiple transparent objects requires sorting the object's order of display based on their apparent position relative to the observer. There are two different depth sorting options, each requires progressively more computation and is therefore increasingly slower than normal rendering. Remember that these options are not available in OpenGL since none of the graphics card manufacturers support this level of sophistication. 576
Camera menu provides control over many settings that affect the appearance of your model. These include: 1. Turning Auto-Normalize on or off 2. Turning Perspective on or off 3. Advanced Settings lets you a. Control additional auto-normalize behavior b. Set auto-normalize scale c. Control the field of view when in perspective mode 577
C Tech Help System for EVS and MVS 9.8 Light menu allows you to control how lighting affects the shading and color of objects in your view. The options include: 1. Whether to show lights 2. Whether to transform lights or objects with your mouse 3. Advanced Settings lets you a. Set the properties of individual lights b. Turn lights on/off c. Set light's color 578
Audio menu allows you to control whether to include audio, and the audio volume 1. Whether to enable Audio. 2. Adjust Volume using a slider. 3. Increase Volume. 4. Decrease Volume. 579
C Tech Help System for EVS and MVS 9.8 Configure 4DIM Player When you install the 4DIM player, a shortcut for the program that allows you to customize the start-up behavior of the player is also included. When you run this a window appears that allows you to set start-up conditions for the player. This program allows you to set the default: 1. Renderer 2. Background color 3. Delay time 4. Run Mode 5. Setting for Perspective 6. Always on top 7. Window size and position (NOTE: The window size/position is the size position of the ENTIRE window, not the renderable section.) When you save these settings they will apply to the player each time you start it in the future. Note that this does not change the settings of an open player. 580
Exit 4DIM Player The ability to exit is only available on the stand-alone 4DIM Player. To exit the 4DIM Player, select the File->Exit pull-down command. The 4DIM Player exits after displaying a confirmation message. 581