I have a particle system for which I basically track coordinates. So far I was output all the coordinates in the files, then do it with a Gnuplot script and using FFPAP to make a video from PGG. To leave all file I / O, I did not take any advantage before OpenGL, so I thought of installing a pipe for Gnuplot.
I like it in MSVC 2012: Pclose , and This is very consistent in Linux I I am working with 100 particles most of the time. I can have more than 10,000 time-consuming steps. I do not know that this is a lot. I suspect cut-offs in windows or some things, though I'm setting buffer with a tap. I am working in WinXX64 and QT in MSVC in Linux Mint X64 in versionbank I am using gnuplot 4.7 (win) and 4.6.0.8 (linux). I have seen very much in SO and only one problem I have found is that This question is not unanswered. Puts a single window with a silly animation. However, I would not be surprised that some other drivers try to open a window for each frame FILE * gnuplotpipe = _popen (GNUPLOT_NAME, "w"); Setwuf (Gnuplotipipe, Faucet, _IONBF, Faucet); // Setbuff (GnuplotPipe, Faucet); Fprintf (gnuplotpipe, "set word png \ n"); Fprintf (gnuplotpipe, "size size 720, 480 \ n"); Fprintf (gnuplotpipe, "set size ratio -1 \"); Fprintf (gnuplotpipe, "unset \ n"); Fprintf (gnuplotpipe, "set xrange [-% d:% d] \ n", RANGE + 100, RANGE + 100); Fprintf (gnuplotpipe, "set yrange [-% d:% d] \ n", RANGE + 100, RANGE + 100); For calculating fprintf (gnuplotpipe, "% f% f \ n", particle [//] for the (time-phase) // Doo Stuffprint (gnuplotpipe, "plot" - '\ n "); (all particles) I] - end for ffush (gnuplotpipe, "e \ n"); // fflush (gnuplotpipe); _pcloce (gnuplotpipe); <-> <->, x [i] -> y); end for fprintf;
gnuplot -persist instead of
popen and
instead of
setbuf instead of
setvbuf . It was already with much testing and error.
-persist is not actually released in windows. Any help would be appreciated.
import subprocessation F = subprances. Popen (['/ usr / bin / gnuplot', '- persist'], stdin = subprocess.PIPE, shell = falls) f.stdin.write ('set term x11 \ n') f.stdin (I) == 50: d * = -1 i + = 1 If IRCTET = 1000 IT = = d f.stdin.write ('plot' '\' points with lines 4 PS2 \ n ') in range Range (0,500): F.stdin.write ('% f% f \ n'% (float (j), math.sin (float (j) / float (abs (i) +1)))) f.stdin.write ('e \ N ')
No comments:
Post a Comment