|
我运行了osg自带的例子osgcluster,打算对它进行再开发,运行时要用到命令行参数输入,比如启动主机要用:multihal.exe -m cow.osg来启动一个场景,并显示牛模型,现在我想在加入另一个模型进去,不知道如何写代码,找到本程序arugments部分,示例如下:- osg::ArgumentParser arguments(&argc,argv);
- // set up the usage document, in case we need to print out how to use this program.
- arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the example which demonstrates how to approach implementation of clustering.");
- arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
- arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
- arguments.getApplicationUsage()->addCommandLineOption("-m","Set viewer to MASTER mode, sending view via packets.");
- arguments.getApplicationUsage()->addCommandLineOption("-s","Set viewer to SLAVE mode, receiving view via packets.");
- arguments.getApplicationUsage()->addCommandLineOption("-a ","add another child node to scene"); //add node to scene
复制代码
这是部分实现代码
- ViewerMode viewerMode = STAND_ALONE;
- while (arguments.read("-m")) viewerMode = MASTER;
- while (arguments.read("-s")) viewerMode = SLAVE;
复制代码
不过不知道该如何添加模型函数。这里都是针对viewer的,请问思路应该是什么呢?也要针对viewer添加模型吗?能列出具体函数最好,谢谢 |
|