本文整理汇总了C++中Navigator::setFrom方法的典型用法代码示例。如果您正苦于以下问题:C++ Navigator::setFrom方法的具体用法?C++ Navigator::setFrom怎么用?C++ Navigator::setFrom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Navigator
的用法示例。
在下文中一共展示了Navigator::setFrom方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char **argv)
{
osgInit(argc, argv);
int winid = setupGLUT(&argc, argv);
GLUTWindowPtr gwin= GLUTWindow::create();
#if OSG_MAJOR_VERSION >= 2
gwin->setGlutId(winid);
#else
gwin->setId(winid);
#endif
gwin->setSize(600, 600);
gwin->init();
glutPositionWindow(400, 400);
scene = createScenegraph();
#if OSG_MAJOR_VERSION >= 2
traverse(scene, boost::bind(assignChairNodes,_1));
#else
traverse(scene, osgTypedFunctionFunctor1CPtrRef
<Action::ResultE, NodePtr>(assignChairNodes));
#endif
chairNodes[6] = model;
mgr = new SimpleSceneManager;
mgr->setWindow(gwin);
mgr->setRoot(scene);
#if OSG_MAJOR_VERSION >= 2
CameraPtr pc = mgr->getCamera();
beginEditCP(pc, CameraBase::NearFieldMask | CameraBase::FarFieldMask);
pc->setNear(-2000);
pc->setFar(2000);
endEditCP(pc, CameraBase::NearFieldMask | CameraBase::FarFieldMask);
#else //OpenSG1:
PerspectiveCameraPtr pc = mgr->getCamera();
beginEditCP(pc, PerspectiveCamera::NearFieldMask |
PerspectiveCamera::FarFieldMask);
pc->setNear(-2000);
pc->setFar(2000);
endEditCP(pc, PerspectiveCamera::NearFieldMask |
PerspectiveCamera::FarFieldMask);
#endif
mgr->showAll();
Navigator* nav = mgr->getNavigator();
nav->setFrom(nav->getFrom() + Vec3f(0.0f, 50.0f, 0.0f));
printUsage();
glutMainLoop();
return 0;
}
示例2: setCameraPosition
void SpaceNavigatorSSM::setCameraPosition(Pnt3f position)
{
Navigator* nav = getNavigator();
// set new look at point = old look at + new Position - old Position
nav->setAt(nav->getAt() + position - nav->getFrom());
// set new position
nav->setFrom(position);
}
示例3: main
int main(int argc, char **argv)
{
osgInit(argc,argv);
int winid = setupGLUT(&argc, argv);
GLUTWindowPtr gwin= GLUTWindow::create();
gwin->setId(winid);
gwin->init();
scene =createScenegraph();
mgr = new SimpleSceneManager;
mgr->setWindow(gwin );
mgr->setRoot (scene);
mgr->showAll();
Navigator * nav = mgr->getNavigator();
nav->setFrom(nav->getFrom()+Vec3f(0,50,0));
glutMainLoop();
return 0;
}