|
FhSim
3.1.0
Marine systems simulation
|
This page covers practical ways to capture visual output when running FhVis.
Add a <FileRenderer> observer to the <OBSERVERS> section and run with FhVis. One frame at time 15 s:
The picture shows the state at exactly 15 s, interpolated between the two solver steps around it. It has the size you give, whatever the window size, and it shows the scene only, without the Hud. outputFile needs one integer field, so a single shot is best named shot_%05d.png. The frame count is the file number: the first file is shot_00000.png.
To export frames from 15 s to 100 s at 24 frames per simulation second:
The files are frames/frame_00000.png, frame_00001.png, and so on, with no gaps. Only the listed observers run, so list <FileOutput> if you also want a result file. <FileRenderer> replaces the old Camera/Shot SimObject. Do not list <Visualization> beside it: <FileRenderer> draws the window itself, and outside [startTime, stopTime] it draws one window frame per simulation second (fpsOutsideFileRenderWindow).
Let FhVis encode the video for you:
output="both" keeps the PNG files too, for example for annotation. ffmpeg must be on PATH, or set ffmpegExecutable. See FileRenderer for every attribute.
You can also encode the PNG files yourself:
Add <Overlays> inside <FileRenderer> to draw a logo and the simulation time on every frame:
The image path is relative to the folder of the input file. Add start, duration and fade to an item to show it only for a while. See Overlays for every attribute.
For a richer annotation, write a LaTeX .tex file and let fhsim_video make the PNG: python3 fhsim_video.py TEX. The PNG lands next to the .tex file. Then name that PNG in an <Image> item.
Tips:
crf gives better quality and larger files.You can define camera waypoints with Camera/Controller2. Each waypoint i has a start time in Time and three input ports: Position<i> (x,y,z), Pitch<i> and Yaw<i>:
NumInput and the number of Time entries equal to the number of waypoints. Camera/Controller is a second camera object that follows targets with distance, azimuth and elevation.