本文整理汇总了C++中ViewportRefPtr::getCamera方法的典型用法代码示例。如果您正苦于以下问题:C++ ViewportRefPtr::getCamera方法的具体用法?C++ ViewportRefPtr::getCamera怎么用?C++ ViewportRefPtr::getCamera使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ViewportRefPtr
的用法示例。
在下文中一共展示了ViewportRefPtr::getCamera方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doMain
//
// setup scene
//
static int doMain(int argc, char *argv[])
{
preloadSharedObject("OSGFileIO");
preloadSharedObject("OSGImageFileIO");
osgInit(argc,argv);
int winid = setupGLUT(&argc, argv);
win = GLUTWindow::create();
win->setGlutId(winid);
win->init();
if(argc < 2)
{
FWARNING(("No file given!\n"));
FWARNING(("Supported file formats:\n"));
std::list<const char*> suffixes;
SceneFileHandler::the()->getSuffixList(suffixes);
for(std::list<const char*>::iterator it = suffixes.begin();
it != suffixes.end();
++it)
{
FWARNING(("%s\n", *it));
}
staticScene = createStaticScene();
}
else
{
staticScene = SceneFileHandler::the()->read(argv[1]);
}
dynamicScene = createDynamicScene();
commitChanges();
mgr = SimpleSceneManager::create();
NodeUnrecPtr root = makeCoredNode<Group>();
root->addChild(staticScene);
mgr->setWindow(win);
mgr->setRoot (root);
GradientBackgroundUnrecPtr background = GradientBackground::create();
background->addLine(Color3f(0,0,0), 0);
background->addLine(Color3f(1,1,1), 1);
staticVp = win->getPort(0);
staticVp->setBackground(background);
camera = staticVp->getCamera();
mgr->showAll();
return 0;
}