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


C++ setupCamera函数代码示例

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


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

示例1: ofxArtoolModePatt

bool ofxArtool5::setupPattern(ofVec2f _camSize, ofVec2f _viewportSize, ofPixelFormat pf, string pthCamParam, string pthMarker){
    
    artMode=ART_PATTERN;
    curArtMode=(ofxArtoolMode*)(new ofxArtoolModePatt());
    curArtMode->gCparamLT=gCparamLT;
    
    if(!setupCamera(pthCamParam, _camSize, _viewportSize)){
        return false;
    }
    
    return true;
    
    artMode=ART_PATTERN;
    curArtMode = (ofxArtoolMode * )(new ofxArtoolModePatt());
    curArtMode->gCparamLT = gCparamLT;
    
    bPattFound = false;
    selectedId = -1;
    
    if(!setupCamera(pthCamParam, _camSize, _viewportSize)){
        return false;
    }
    
    arUtilTimerReset();
    
    if(!setupMarker(pthMarker)){
        cleanup();
        return false;
    }
    
    return true;
}
开发者ID:Avatarchik,项目名称:ofxArtool5,代码行数:32,代码来源:ofxArtool5.cpp

示例2: Scene

HMDScene::HMDScene():
  Scene(),
  _left_cam(NULL),
  _right_cam(NULL)
{
  
  auto s = Director::getInstance()->getWinSize();
  float ratio = (GLfloat)s.width / s.height;
  
  _head_node = Node::create();
  Scene::addChild(_head_node);
  
  _attach_node_left = Node::create();
  _attach_node_right = Node::create();
  
  _left_cam = setupCamera( ratio, true);
  _attach_node_left->addChild(_left_cam);
  _head_node->addChild(_attach_node_left);
  
  _right_cam = setupCamera( ratio, false);
  _attach_node_right->addChild(_right_cam);
  _head_node->addChild(_attach_node_right);
  
  _cam_mask = ((unsigned short)CameraFlag::USER7) | ((unsigned short)CameraFlag::USER8);

  setHeadPosition3D(Vec3::ZERO);
  setHeadRotationQuat(Quaternion(Vec3::UNIT_Z, 0.0f));
  setEyeDistanceMillimeters(s_IPDmm);
}
开发者ID:asuo1986,项目名称:own,代码行数:29,代码来源:CCHMDScene.cpp

示例3: processMouseEvents

void processMouseEvents(float factor)
{
    int x;
    int y;

    int cx = scene->context->w / 2;
    int cy = scene->context->h / 2;

    float sensitivity = 0.05f;

    float dx, dy;

    glfwGetMousePos(&x, &y);

    dx = sensitivity * ((float) cx - (float) x);
    dy = sensitivity * ((float) cy - (float) y);

    if (dx == 0.0f && dy == 0.0f)
    {
        return;
    }

    if (glfwGetKey(GLFW_KEY_LSHIFT) == GLFW_PRESS ||
        glfwGetKey(GLFW_KEY_RSHIFT) == GLFW_PRESS)
    {
        float slide = SLIDE_STEP * factor;

        dx *= slide;
        dy *= slide;

        slideCamera(scene->camera, -dx, dy, 0.0f);
    }
    else
    {
        float rotate = ROTATE_STEP * factor;

        dx *= rotate;
        dy *= rotate;

        rotateCamera(scene->camera, dx, 0.0f, 0.0f);
        rotateCamera(scene->camera, 0.0f, -dy, 0.0f);
    }

    if (scene->world != NULL)
    {
        setupCamera(scene->world->sp, scene->camera);
    }

    if (scene->water != NULL)
    {
        setupCameraAlter(scene->water->modifySP, scene->camera);
        setupCamera(scene->water->drawSP, scene->camera);
    }

    glfwSetMousePos(cx, cy);
}
开发者ID:achellies,项目名称:WaveSimulation,代码行数:56,代码来源:main.c

示例4: setupWindow

	bool Application::Setup()
	{
		// Make the window
		setupWindow();

		// Setup System Time
		_systemTime->Setup();

		// Setup containters
		_timerContainer->Setup();
		_physicsContainer->Setup();
		_rendererContainer->Setup();
		_gameObjectContainer->Setup();

		// Setup the registries
		_meshRegistry->Load();
		_shaderRegistry->Load();
		_meshRegistry->SetupAllVertexFormats();
		_textureRegistry->Load();
		_materialRegistry->Load();
		_audioRegistry->Load();
		_fontRegistry->Load();
		_prefabRegistry->Load();
		_sceneRegistry->Load();

		// Setup camera
		setupCamera();

		return true;
	}
开发者ID:JISyed,项目名称:SF3DEW,代码行数:30,代码来源:Application.cpp

示例5: init

bool ARTApp::init(const char *cparamName, const char *pattName, const char *objModelFile, float pattWidth, float modelScale)
{
	if (arHandle) //has initialized
		return false;

	if (!setupCamera(cparamName, "", &cParam, &arHandle, &ar3DHandle)) {
		return false;
	}

	if (!setupMarker(pattName, &pattID, arHandle, &pattHandle)) {
		return false;
	}

	{
		objModel = glmReadOBJ((char*)objModelFile);
		if (!objModel)
		{
			ARLOGe("Unable to load obj model file.\n");
			return false;
		}
		glmUnitize(objModel);
		glmScale(objModel, pattWidth*modelScale);
	}
	this->pattWidth = pattWidth;

	return true;
}
开发者ID:imbinwang,项目名称:simpleARDIY,代码行数:27,代码来源:DIY.cpp

示例6: error_

VisionEngine::VisionEngine(const char* name, application_settings *config)
: error_( false )
, pause_( false )
, calibrate_( false )
, help_( false )
, display_lock_( false )
, current_fps_( 0 )
, camera_ (NULL)
, framenumber_( 0 )
#ifndef NDEBUG
, recording_( false )
#endif
, interface_ ( NULL )
, frames_( 0 )
, width_( WIDTH )
, height_( HEIGHT )
, format_( 1 )
{
    app_config_ = config;
    camera_config_ = CameraTool::readSettings(app_config_->camera_config);
    setupCamera();
	
    lastTime_ = currentSeconds();
    cameraTime_ = processingTime_ = interfaceTime_ = totalTime_ = 0.0f;
    
    app_name_ = std::string(name);
}
开发者ID:mkalten,项目名称:reacTIVision,代码行数:27,代码来源:VisionEngine.cpp

示例7: _TextureWidth

AggregatePass::AggregatePass(osg::TextureRectangle *diff_tex0,
							 osg::TextureRectangle *diff_tex1,
							 osg::TextureRectangle *diff_tex2,
							 osg::TextureRectangle *diff_tex3,
							 osg::TextureRectangle *agg_tex_in,
							 osg::TextureRectangle *agg_tex_out,
							 int width, int height,
							 int start_disparity, int window_size):
    _TextureWidth(width),
    _TextureHeight(height),
    _StartDisparity(start_disparity),
    _WindowSize(window_size)
{
    _RootGroup = new osg::Group;

    _InTextureDifference[0] = diff_tex0;
    _InTextureDifference[1] = diff_tex1;
    _InTextureDifference[2] = diff_tex2;
    _InTextureDifference[3] = diff_tex3;

    _InTextureAggregate = agg_tex_in;
    _OutTextureAggregate = agg_tex_out;

    _OutTexture = _OutTextureAggregate;

    _Camera = new osg::Camera;
    setupCamera();
    _Camera->addChild(createTexturedQuad().get());

    _RootGroup->addChild(_Camera.get());

    setShader("shaders/stereomatch_aggregate.frag");

}
开发者ID:yueying,项目名称:osg,代码行数:34,代码来源:StereoMultipass.cpp

示例8: if

void VideoSource::setupCamera()
{

    if (videoType == VideoTypeMovie) {

        if (movieFilePath.size() <= 0) {
            cout << "error:  movieFilePath not defined" << endl;
            return;
        }

        vidPlayer.loadMovie(movieFilePath);
        vidPlayer.play();


    } else if (videoType == VideoTypeOfVideoGrabber || videoType == VideoTypeCodeLabsPSEye) {

        setupCamera(0);

    } else if (videoType == VideoTypeDcCameraGrabber) {

        #ifdef TARGET_OSX
        dcCameraGrabber.setup();
        dcCameraGrabber.camera.setSize(320, 240); // TODO should pass in desired width & height here
        #endif

    } else if (videoType == VideoTypePS3EyeGrabber) {
        #ifdef TARGET_OSX
        ps3EyeGrabber.setupCamera(320, 240);
        #endif
    }
}
开发者ID:corybarr,项目名称:ofxVideoSource,代码行数:31,代码来源:VideoSource.cpp

示例9: render

void Scene :: render(void) {
	if(!setupCamera())
		printf("Error - File: Scene.cpp - Setup of the camera.");
	if(Group::setupLight() > 0)
		glEnable(GL_LIGHTING);
	Group::render();
}
开发者ID:lfmachadodasilva,项目名称:scene_graph,代码行数:7,代码来源:Scene.cpp

示例10: shutdown

void VideoCapture::setCaptureSize(QSize size)
{
    if (size.width() != width || size.height() != height) {
        shutdown();
        setupCamera(size);
    }
}
开发者ID:opieproject,项目名称:opie,代码行数:7,代码来源:videocaptureview.cpp

示例11: setupCamera

void Application::createScene(void)
{
    setupCamera();
    setupTextureFiltering();

    /* Render environment */
    environment = new EnvironmentRenderer(mSceneMgr);
    environment->render();

    /* Render city */
    city = new OgreCity(mSceneMgr);
    city->setTerrain(environment->getTerrain());
    city->render();

    /* Add a custom ogre :-) */
//  Ogre::Entity* ogre = mSceneMgr->createEntity("Ogre", "ogrehead.mesh");
//  ogre->setCastShadows(true);
//  Ogre::SceneNode* ogreNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
//  ogreNode->attachObject(ogre);
//  ogreNode->setPosition(Ogre::Vector3(0, 300, 0));
//
//  Ogre::Entity* ogre2 = mSceneMgr->createEntity("Ogre2", "ogrehead.mesh");
//  Ogre::SceneNode* ogreNode2 = ogreNode->createChildSceneNode();
//  ogreNode2->attachObject(ogre2);
//  ogreNode2->translate(Ogre::Vector3(100, 0, 0));
//  ogreNode2->yaw(Ogre::Degree(-30));
}
开发者ID:zwp2010luck,项目名称:OgreCity,代码行数:27,代码来源:application.cpp

示例12: ScreenPass

SSAOPass::SSAOPass(osg::Camera *mainCamera, osg::TextureRectangle *positionTex, osg::TextureRectangle *normalTex, osg::Texture2D *randomJitterTex, osg::Texture2D *sharedDepthTex)
: ScreenPass(mainCamera)
{
    _ssao_shader_id = addShader("ssao.vert", "ssao.frag");
    _in_position_tex = addInTexture(positionTex);
    _in_normal_tex = addInTexture(normalTex);
    //_in_random_tex = addInTexture(randomJitterTex);
    _randomTexture2D = randomJitterTex;
    _blurCamera = new osg::Camera;
    
    _blurX_shader = addShader("gBlur.vert", "gBlurSSAOX.frag");
    _blurY_shader = addShader("gBlur.vert", "gBlurSSAOY.frag");
    
    setSSAOParameters(0.5f, 30.0f, 0.3f, 0.36f);
    
    setupCamera();
    configRTTCamera();
    
    // get matrix and farPlaneDist
    osg::Matrix projMatrix = mainCamera->getProjectionMatrix();
    float dummy;
    // TODO: fix nearPlane
    projMatrix.getFrustum(dummy, dummy, dummy, dummy, dummy, _farPlaneDist);
   
    _sharedDepthTex = sharedDepthTex;
    configureStateSet();
    setupBlurCamera();
}
开发者ID:wqxhouse,项目名称:VRApp,代码行数:28,代码来源:SSAOPass.cpp

示例13: createGround

	void DemoKeeper::createScene()
	{
		base::BaseDemoManager::createScene();
		std::string controllerCategory = MyGUI::ControllerManager::getInstance().getCategoryName();
		MyGUI::FactoryManager::getInstance().registerFactory<ControllerRandomSelected>(controllerCategory);
		MyGUI::FactoryManager::getInstance().registerFactory<ControllerRandomProgress>(controllerCategory);
		MyGUI::FactoryManager::getInstance().registerFactory<ControllerSmoothProgress>(controllerCategory);
		MyGUI::FactoryManager::getInstance().registerFactory<ControllerSmoothCaption>(controllerCategory);

		std::string resourceCategory = MyGUI::ResourceManager::getInstance().getCategoryName();
		MyGUI::FactoryManager::getInstance().registerFactory<ResourceDevice>(resourceCategory);

		std::string layerCategory = MyGUI::LayerManager::getInstance().getCategoryName();
		MyGUI::FactoryManager::getInstance().registerFactory<MyGUI::RTTLayer>(layerCategory);

		createGround();
		createObject();

		setupCamera();

		MyGUI::ResourceManager::getInstance().load("Resources.xml");

		mCommandManager = new CommandManager();
		mMonitorPanel = new MonitorPanel();
		mKeyboardPanel = new KeyboardPanel();
	}
开发者ID:MyGUI,项目名称:mygui,代码行数:26,代码来源:DemoKeeper.cpp

示例14: setBackgroundColor

void Scene::init()
{
	// Options
	this->viewMode = VIEW;
	this->selectMode = SELECT_NONE;

	// Background
	setBackgroundColor(backColor = QColor(50,50,60));

	// Lights
	setupLights();

	// Camera
	setupCamera();

	// Material
	float mat_ambient[] = {0.1745f, 0.01175f, 0.01175f, 1.0f};
	float mat_diffuse[] = {0.65f, 0.045f, 0.045f, 1.0f};
	float mat_specular[] = {0.09f, 0.09f, 0.09f, 1.0f};
	float high_shininess = 100;

	glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
	glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
	glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
	glMaterialf(GL_FRONT, GL_SHININESS, high_shininess);

	// Redirect keyboard
	setShortcut( HELP, Qt::CTRL+Qt::Key_H);
}
开发者ID:HonghuaLi,项目名称:stacker,代码行数:29,代码来源:Scene.cpp

示例15: pow

void Rasterizer::RenderPixelsOMP()
{
    int size = pow(m_renderingParams->size(),2);
    float delta = 1.0/(float)size;
    m_percentDone = 0;
    int boxSize = min(m_renderingParams->size()/60, 4);
    if (m_isPreview)
        boxSize = 1;

//    boxSize = 1;

#pragma omp parallel for
    for (int k=0;k<size;k++) {
        if (m_abort)
            continue;
        int idx = m_renderList[ k ];

        QVector3D dir = setupCamera(idx);
        RasterPixel rp = renderPixel(dir, m_galaxies);
        m_percentDone+=delta;

        int i = idx%(int)m_renderingParams->size();
        int j = (idx-i)/(int)m_renderingParams->size();

        m_renderBuffer->DrawBox(m_backBuffer, i,j, boxSize, rp.I());

    }

    m_abort = false;

}
开发者ID:leuat,项目名称:gamer,代码行数:31,代码来源:rasterizer.cpp


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