如何解决在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 举报,一经查实,本站将立刻删除。