1. Prepare Geometry DataThe VPT-WinFrame3D-Viewer, hereafter called WF3d, can be run interchangably from a stored file or from a live socket. Sometimes it is handy to combine a mixture of both methods. For example, define the landscapes, fixed structures, and vehicle shapes in a file which rarely changes. Then control the movements of vehicles via sockets from your simulation models. The command formats are the same either way. Therefore we will not dwell on the specific interface at this point.
In the drawing and managing graphical objects, the basic steps are as follows:
1.1 Adding fprintf's or Socket Calls to ModelsAdd fprintf or socket calls to your models to generate the above commands.
. . .
You can specify geometries and commands in any combination of files and sockets. Useful ideas include making separate files for various kinds of object definitions such as:
While all the above might be defined in static files which can be mixed and matched for rapid configuration, the movement commands may be provided by live simulation programs through sockets.
In this example, basic definitions of objects are provided by various combinations of files. Instantiations are provided by other files, and the movement of entities are controlled by a combination of simulators, perhaps controlling the foe and friendly forces diametrically opposed. - Or, everything could be combined into a single file, such as for archival playback.
1.2 Choosing Coordinate Region for Your Virtual WorldYou will specify the locations of your objects in cartesion 3-space (x, y, and z). The values may be anything you want, to place objects where they are needed. There are no minimums or maximums as far as the WF-3D tool is concerned. However, there is a min and max range that you set in the camera statement, which defines the viewable frustum in the initial camera position. Naturally you can move the camera position, but the "depth of field" remains the same.
Figure 1 - WinFrame Coordinate Aves.
Once you have decided on the region of your virtual world, set the camera position to be either somewhere
within the region, or slightly back from it, to one side, at slight altitude aiming toward the center.
You can always move the camera once the viewing starts. Above is just an example, you can always define a different game/map region which could be oblong, etc..
2. Run Simulation with 3D-ViewerInvoke WF3D with the file(s) and/or socket(s) which will drive the animation, as shown in the example above. If you invoke WF3D without any files on the command-line, it will prompt you for a file to load by opening a file-browser. You can then navigate to, and select the file you want to display.
When WF3d displays a scene, you will see a Controls button on the upper left of the screen. Pressing it will open a small control panel, which contains a small set of commonly used controls, as shown below.
A similar, but richer set of controls is also listed after the version number on the text window from which you started WF3d, or by pressing the Help button on the control-panel, as shown below:
1. Move camera into scene (zoom-z). 2. Move camera around scene (xy). 3. Translate camera over scene (xy+aim). 4. Rotate camera about scene (xz). 5. Move camera's aim-point. (xz). 6. Move camera's aim-height. (y). 7. Zoom camera to/from origin (xyz). 8. Move last-added object (xz). 9. Rotate last-added object (y-axis). s. Stop/start AutoPan - Automatic camera rotation about origin. t. Start/stop AutoTour of outer loop.. v. Value for speed setting, stops, prompts & accepts value. z. Start/stop AutoZoom - Automatic zoom toward origin. p. Snap Picture. c. Show Camera Coordinates. m. Meta functions. h. Help. q. Quit. Meta Functions: 1. View Angle (FOV) 2. Near-Field Limit 3. Far-Field Limit m. Toggle back to non-meta mode.Clicking the function in the control panel, or pressing the number or letter shown in the menu (with mouse focus in the WF3d window), either puts the viewer in the mode to control the specified attribute or carries out the intended function. The mouse scroll-wheel zooms in and out.
For example, pressing 1 causes left-right arrow presses (or mouse left-right movements) to move the camera position along the Z-axis toward or away from the origin. Pressing 2 causes the arrow keys (or mouse) to move the camera in the X-Y plane. With a little practice, you can become adroit at manipulating the camera's position and pointing direction, around and through a scene.
Other commands, such as p cause a picture to be snapped of the current scene, without altering the pointing mode. Pressing c causes the camera's coordinates to be displayed. This is handy when trying to find a good initial camera setting to place in a file.
The letters s, t, and z put the camera into preplanned trajectories of continuous motion. S Scans around a circular orbit of the origin at whatever radius you position it. You can even change the radius as it scans. T takes the camera on a Tour which follows a similar orbit, but looks ahead in the direction of motion, instead of toward the center. Z Zooms the camera toward the origin, where it begins a slow rotation looking out around the horizon. Pressing any of these letters a second time, stops the camera's motion. Pressing it again resumes it. You can switch smoothly between motions by simply switching between them directly.
Less frequently used commands are relegated to the second level Meta menu. Go into / or out-of the meta mode by pressing m.
Some other arcane commands are not listed, such as:
WF3d Command Line Options.
WF-3D Viewer Operation.
See also: WF3d