在OpenGL窗口中绘制gnuplot图

问题描述

我正在模拟对象的运动并用OpenGL表示它。移动对象显示在fltk窗口的子窗口1中。我想在子窗口2中显示它旁边的一些物理量的实时图。现在,我知道如何从程序中调用gnuplot,以便在单独的窗口中执行它:

    std::ofstream ou ("instructions.txt");
    ou <<"set palette rgb '#27ad81'" <<std::endl<<"splot \"file.txt\" every ::-1::0 with points palette pointsize 2 pointtype 2   notitle " << std::endl;
    for( int i = 0; i<(tf/h); i+=(0.1/h)){ //h is the time increment,tf is the time at which the simulation stops
        ou << "pause 0.1" << std::endl;
        ou << "replot \"file.txt\" every ::" << i << "::" << (i+(0.1/h)) << "with points palette pointsize 1 pointtype 1  notitle "<< std::endl;
    }
    system("gnuplot instructions.txt");
}

是否可以将gnuplot的输出重定向到子窗口2?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)