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


C++ createCamera函数代码示例

本文整理汇总了C++中createCamera函数的典型用法代码示例。如果您正苦于以下问题:C++ createCamera函数的具体用法?C++ createCamera怎么用?C++ createCamera使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了createCamera函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: QWidget

ViewerWidget::ViewerWidget(osgViewer::ViewerBase::ThreadingModel threadingModel) :
    QWidget() {

    // Create main layout
    //_mainLayout = new QVBoxLayout;
    // No space between window's element and the border
    //_mainLayout->setMargin(0);
    // No space between window's element


    // Create window title bar
    //_windowTitleBar = new WindowTitleBar;
    // Add window title bar to main layout
    //_mainLayout->addWidget(_windowTitleBar);
    // Put the title bar at the top of the window


    _scene = new osg::Group;
    _viewTopLookDir = osg::Y_AXIS;
    _viewTopUp = osg::Z_AXIS;

    _viewLeftLookDir = osg::Z_AXIS;
    _viewLeftUp = -osg::Y_AXIS;

    _viewFrontLookDir = osg::X_AXIS;
    _viewFrontUp = -osg::Y_AXIS;

    _viewMainLookDir = osg::Y_AXIS;
    _viewMainUp = osg::X_AXIS;

    setThreadingModel(threadingModel);

    _widgetTop   = addViewWidget(createCamera(0,0,10,10), Top  );
    _widgetLeft  = addViewWidget(createCamera(0,0,10,10), Left );
    _widgetFront = addViewWidget(createCamera(0,0,10,10), Front);
    _widgetMain  = addViewWidget(createCamera(0,0,10,10), Main );

    _leftVBoxLayout = new QVBoxLayout;
    _rightVBoxLayout = new QVBoxLayout;

    _mainHBoxLayout = new QHBoxLayout;
    _mainHBoxLayout->addLayout(_leftVBoxLayout);
    _mainHBoxLayout->addLayout(_rightVBoxLayout);

    //_mainLayout->addLayout(_mainHBoxLayout);

    changeViews();

    //setLayout(_mainLayout);
    setLayout(_mainHBoxLayout);

    connect(&_timer, SIGNAL(timeout()), this, SLOT(update()));
    _timer.start(10);
}
开发者ID:vmichele,项目名称:LEGO_VIEWER,代码行数:54,代码来源:ViewerWidget.cpp

示例2: GetCurrentDirectory

//-------------------------------------------------------------------------------------
bool BaseApplication::setup(void)
{
	char dir[MAX_STRING_NUM];
	GetCurrentDirectory(MAX_STRING_NUM, dir);
	std::string inipath = std::string(dir) + "/SIGVerse.ini";
	TCHAR SettingPath[256];
	sprintf_s(SettingPath, 128, inipath.c_str());
	TCHAR pathText[256];
	GetPrivateProfileString("MODE","OCULUS_MODE",'\0', pathText, 1024, SettingPath);
	if(strcmp(pathText,"true") == 0)  OculusMode = true;
	GetPrivateProfileString("MODE","FULLSCREEN_MODE",'\0', pathText, 1024, SettingPath);
	if(strcmp(pathText,"true") == 0)  FullscreenMode = true;


	mRoot = new Ogre::Root(mPluginsCfg);
	setupResources();
	bool carryOn = configure();
	if (!carryOn) return false;
	chooseSceneManager();

	if(OculusMode){
		Ogre::ResourceGroupManager::getSingleton().addResourceLocation("media","FileSystem");
		// Load resources
		loadResources();
		oculus.setupOculus();
		oculus.setupOgre(mSceneMgr, mWindow);

		createCamera();
	}
	else{
		createCamera();
		createViewports();

		// Load resources
		loadResources();
	}
	// Set default mipmap level (NB some APIs ignore this)
	Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);

	// Create any resource listeners (for loading screens)
	createResourceListener();

	// Create the scene
	createScene();

	createFrameListener();

    return true;
};
开发者ID:Aharobot,项目名称:Client,代码行数:50,代码来源:BaseApplication.cpp

示例3: createCamera

//==============================================================================
//
//------------------------------------------------------------------------------
Camera::Camera()
  :_currentCam(nullptr)
  ,_moveToCamera(nullptr)
  ,_nowFrame(0)
  ,_maxFrame(0)
{
  // デフォルトカメラ
  _defaultCam = createCamera();
  _defaultCam->setPosP(Vec3(0,50,-200));
  _defaultCam->setPosR(Vec3(0,0,0));
  _defaultCam->setVecU(Vec3(0,1,0));

  _destCamera = createCamera();
  setCamera(_defaultCam);
}
开发者ID:h406,项目名称:project,代码行数:18,代码来源:camera.cpp

示例4: createCamera

void VirtualCamera::init(osg::Group *uwsim_root, std::string name, osg::Node *trackNode, int width, int height, double baseline, std::string frameId, Parameters *params,int range,double fov) {
	this->uwsim_root=uwsim_root;
	this->name=name;

	this->trackNode=trackNode;
	//Add a switchable frame geometry on the camera frame
        osg::ref_ptr<osg::Node> axis=UWSimGeometry::createSwitchableFrame();
	this->trackNode->asGroup()->addChild(axis);	

	this->width=width;
	this->height=height;
	this->baseline = baseline;
	this->frameId = frameId;
	this->fov=fov;
	if(params!=NULL){
	  this->fx=params->fx;
	  this->fy=params->fy;
	  this->far=params->f;
	  this->near=params->n;
	  this->cx=params->x0;
	  this->cy=params->y0;
	  this->k=params->k;
	  this->paramsOn=1;
        }
	else
	  this->paramsOn=0;
	this->range=range;
        
	renderTexture=new osg::Image();
	renderTexture->allocateImage(width, height, 1, GL_RGB, GL_UNSIGNED_BYTE);
	depthTexture=new osg::Image();
	depthTexture->allocateImage(width, height, 1, GL_DEPTH_COMPONENT, GL_FLOAT);

	createCamera();
}
开发者ID:perezsolerj,项目名称:underwater_simulation,代码行数:35,代码来源:VirtualCamera.cpp

示例5: setupResources

//------------------------------------------------------------------------------
bool BaseApplication::setup(void)
{
    root = new Ogre::Root(plugins_cfg);

    setupResources();

    bool carryOn = configure();
    if (!carryOn)
        return false;

    chooseSceneManager();
    createCamera();
    createViewports();

    // Set default mipmap level (NB some APIs ignore this)
    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);

    // Create any resource listeners (for loading screens) and load everything
    createResourceListener();
    loadResources();

    // Create the scene
    createScene();

    createFrameListener();

    return true;
};
开发者ID:wilbefast,项目名称:open-war,代码行数:29,代码来源:BaseApplication.cpp

示例6: setupResources

//-------------------------------------------------------------------------------------
bool BaseApplication::setup(void)
{
    mRoot = new Ogre::Root(Ogre::macBundlePath() + "/Contents/Resources/" + mPluginsCfg);
	
    setupResources();

    bool carryOn = configure();
    if (!carryOn) return false;

    chooseSceneManager();
    createCamera();
    createViewports();

    // Set default mipmap level (NB some APIs ignore this)
    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);

    // Create any resource listeners (for loading screens)
    createResourceListener();
    // Load resources
    loadResources();

    // Create the scene
    createScene();

    createFrameListener();

    return true;
};
开发者ID:jameszaghini,项目名称:ogre-kinect,代码行数:29,代码来源:BaseApplication.cpp

示例7: setupResources

//-------------------------------------------------------------------------------------
bool SystemOgre::ControllerAbstract::setup(void)
{
    mRoot = new Ogre::Root(mPluginsCfg);

    setupResources();

    bool carryOn = configure();
    if (!carryOn) return false;

    chooseSceneManager();
    createCamera();
    createViewports();

    // Set default mipmap level (NB some APIs ignore this)
    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);

    // Create any resource listeners (for loading screens)
    createResourceListener();
    // Load resources
    loadResources();

    // Create the scene
    createScene();

    createFrameListener();

    return true;
};
开发者ID:jeanCarloMachado,项目名称:rpg,代码行数:29,代码来源:ControllerAbstract.cpp

示例8: setupResources

//-------------------------------------------------------------------------------------
bool BaseApplication::setup(void)
{
    mRoot = new Ogre::Root(mPluginsCfg);

    setupResources();

    bool carryOn = configure();
    if (!carryOn) return false;

    chooseSceneManager();
    createCamera();
    createViewports();

    // Set default mipmap level (NB some APIs ignore this)
    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);


    
    // Create background material
    Ogre::MaterialPtr material = Ogre::MaterialManager::getSingleton().create("Background", "General");
    material->getTechnique(0)->getPass(0)->createTextureUnitState("space.jpg");
    material->getTechnique(0)->getPass(0)->setDepthCheckEnabled(false);
    material->getTechnique(0)->getPass(0)->setDepthWriteEnabled(false);
    material->getTechnique(0)->getPass(0)->setLightingEnabled(false);

    // Create background rectangle covering the whole screen
    rect = new Ogre::Rectangle2D(true);
    rect->setCorners(-1.0, 1.0, 1.0, -1.0);
    rect->setMaterial("Background");
     
    // Render the background before everything else
    rect->setRenderQueueGroup(Ogre::RENDER_QUEUE_BACKGROUND);
     
    // Use infinite AAB to always stay visible
    Ogre::AxisAlignedBox aabInf;
    aabInf.setInfinite();
    rect->setBoundingBox(aabInf);
     
    // Attach background to the scene
    Ogre::SceneNode* node = mSceneMgr->getRootSceneNode()->createChildSceneNode("Background");
    node->attachObject(rect);
     
    // Example of background scrolling
    material->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setScrollAnimation(-0.10, 0.0);
     
    // Don't forget to delete the Rectangle2D in the destructor of your application:

    // Create any resource listeners (for loading screens)
    createResourceListener();
    // Load resources
    loadResources();

    // Create the scene
    createScene();
    

    createFrameListener();

    return true;
};
开发者ID:dcastil1983,项目名称:ProjectFunny,代码行数:61,代码来源:BaseApplication.cpp

示例9: render

void render()
{
    if (NULL != pd3dDevice)
    {
        pd3dDevice->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER,
                          D3DCOLOR_XRGB(0, 0, 0),
                          1.0f, 0);
		pd3dDevice->BeginScene();

		// create the camera
		createCamera(0.1f, 10.0f);		// near clip plane, far clip plane

        // Position camera so cube is same projected size as in OpenGL version
		moveCamera(D3DXVECTOR3(0.0f, 0.0f, -1.6f));
		pointCamera(D3DXVECTOR3(0.0f, 0.0f, 0.0f));

		// draw the objects
		drawCube();
        drawCursor();
		
		pd3dDevice->EndScene();
        pd3dDevice->Present(NULL, NULL, NULL, NULL);

    }
}
开发者ID:Codibri,项目名称:HardrockHoliday,代码行数:25,代码来源:main_dx9.cpp

示例10: setupResources

//-------------------------------------------------------------------------------------
bool BaseApplication::setup(void)
{
    Ogre::LogManager * lm = new Ogre::LogManager();
    lm->createLog("Ogre.log", true, false, false);
    mRoot = new Ogre::Root(mPluginsCfg);

    setupResources();

    bool carryOn = configure();
    if (!carryOn) return false;

    chooseSceneManager();
    createCamera();
    createViewports();

    // Set default mipmap level (NB some APIs ignore this)
    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);

    // Create any resource listeners (for loading screens)
    createResourceListener();
    // Load resources
    loadResources();

    // Create the scene
    createScene();

    createFrameListener();

    return true;
};
开发者ID:fiedukow,项目名称:SimCity2013,代码行数:31,代码来源:BaseApplication.cpp

示例11: S_LOG_VERBOSE

void SimpleRenderContext::setupScene(const std::string& prefix)
{
    S_LOG_VERBOSE("Creating new SimpleRenderContext for prefix " << prefix << " with w:" << mWidth << " h:" << mHeight);
    mSceneManager = Ogre::Root::getSingleton().createSceneManager(Ogre::ST_GENERIC, prefix + "_sceneManager");
    //One might wonder why we're not setting the fog to FOG_NONE. The reason is that it seems that due to a bug in either Ogre or OpenGL when doing that, none of the other fog values would be set. Since we use shaders and in the shaders look for the alpha value of the fog colour to determine whether fog is enabled or not, we need to make sure that the fog colour indeed is set.
    mSceneManager->setFog(Ogre::FOG_EXP2, Ogre::ColourValue(0, 0, 0, 0), 0.0f, 0.0f, 0.0f);
// 	mSceneManager->setFog(Ogre::FOG_NONE, Ogre::ColourValue(1,1,1,1), 0.0f, 10000000.0f, 100000001.0f);

    mRootNode = mSceneManager->getRootSceneNode();

    mEntityNode = mRootNode->createChildSceneNode();

    //make the cameranode a child of the main entity node
    mCameraNode = mRootNode->createChildSceneNode();

    mCameraPitchNode = mCameraNode->createChildSceneNode();

    createCamera(prefix);
    //setVisible(false);
    Ogre::ColourValue colour(0.5, 0.5, 0.5);
    mMainLight = mSceneManager->createLight("MainLight");
    mMainLight->setType(Ogre::Light::LT_DIRECTIONAL);
    mMainLight->setDirection(Ogre::Vector3(-1, 0, 0));
    mMainLight->setPowerScale(10); // REALLY bright.
    mMainLight->setDiffuseColour(colour);
    mMainLight->setSpecularColour(colour);
    mMainLight->setVisible(true);

    mSceneManager->setAmbientLight(colour);
    mCameraPitchNode->attachObject(mMainLight);

    resetCameraOrientation();
}
开发者ID:bregma,项目名称:ember,代码行数:33,代码来源:SimpleRenderContext.cpp

示例12: Root

bool EUClient::setup(void)
{
	mRoot = new Root();
	setupResources();

	bool carryOn = configure();
	if (!carryOn) return false;

	chooseSceneManager();
	createCamera();
	createViewports();

	// Set default mipmap level (NB some APIs ignore this)
	TextureManager::getSingleton().setDefaultNumMipmaps(5);

	// Create any resource listeners (for loading screens)
	createResourceListener();
	// Load resources
	loadResources();

	// Create the scene
	createGUI();
	createScene();

	createFrameListener();

	return true;
}
开发者ID:BackupTheBerlios,项目名称:evouni-svn,代码行数:28,代码来源:EUClient.cpp

示例13: setupResources

bool ApplicationBase::setup()
{
	m_Root = OGRE_NEW Ogre::Root(m_PluginsCfg);

	setupResources();

	// RenderSystem setup
	if (!(/*m_Root->restoreConfig() || */m_Root->showConfigDialog()))
	{
		return false;
	}

	// Create a RenderWindow
	m_Window = m_Root->initialise(true, "PhysicsSimulation_Server");

	chooseSceneManager();
	createCamera();
	createViewports();

	// Set default mipmap level, which is related to LOD
	Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);

	loadResources();

	createFrameListener();

	return true;
}
开发者ID:Harbinger1304,项目名称:OgreLab,代码行数:28,代码来源:ApplicationBase.cpp

示例14: setupResources

//-------------------------------------------------------------------------------------
bool BaseApplication::setup(void)
{
#ifdef _DEBUG
    mRoot = new Ogre::Root("plugins_debug.cfg");
#else
    mRoot = new Ogre::Root();
#endif
    setupResources();

    if (!configure()) return false;

    chooseSceneManager();
    createCamera();
    createViewports();

    // Set default mipmap level (NB some APIs ignore this)
    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);

    // Create any resource listeners (for loading screens)
    createResourceListener();
    // Load resources
    loadResources();

    // Create the scene
    createScene();

    createFrameListener();

    return true;
};
开发者ID:aspiringprogrammer,项目名称:Capstone,代码行数:31,代码来源:BaseApplication.cpp

示例15: setupResources

bool Application::setup(void)
{
    Ogre::String pluginsPath = mResourcePath + "plugins.cfg";
    mRoot = new Ogre::Root(pluginsPath, mConfigPath + "ogre.cfg", mResourcePath + "Ogre.log");
    setupResources();
    if (!configure())
        return false;

    chooseSceneManager();
    createCamera();
    createViewports();

    mPlatform = new MyGUI::OgrePlatform();
    mPlatform->initialise(mWindow, mSceneMgr);
    mGUI = new MyGUI::Gui();
    mGUI->initialise("");
    MyGUI::FactoryManager::getInstance().registerFactory<MyGUI::RTTLayer>("Layer");
    MyGUI::ResourceManager::getInstance().load("core.xml");
    
    GuiListener* guiL = new GuiListener(mGUI);
    mInputManager->regKeyboardListener(guiL);
    mInputManager->regMouseListener(guiL);

    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);

    createResourceListener();
    loadResources();
    return true;
}
开发者ID:andrey013,项目名称:mytuner,代码行数:29,代码来源:Application.cpp


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