当前位置: 首页>>代码示例>>C++>>正文


C++ Navigator::setFrom方法代码示例

本文整理汇总了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;
}
开发者ID:flair2005,项目名称:inVRs,代码行数:59,代码来源:main.cpp

示例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);
}
开发者ID:ufz-vislab,项目名称:vislab,代码行数:10,代码来源:SpaceNavigatorSSM.cpp

示例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;
}
开发者ID:mlimper,项目名称:OpenSG1x,代码行数:23,代码来源:09geometry_water2.cpp


注:本文中的Navigator::setFrom方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。