本文整理汇总了C++中setupCamera函数的典型用法代码示例。如果您正苦于以下问题:C++ setupCamera函数的具体用法?C++ setupCamera怎么用?C++ setupCamera使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setupCamera函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: m_fd
V4L2VideoCaptureDevice::V4L2VideoCaptureDevice(int fd):
m_fd(fd),
m_imageBuffer(NULL),
m_converter(NULL)
{
setupCamera();
}
开发者ID:GodFox,项目名称:qtopia-ezx,代码行数:7,代码来源:v4l2videocapturedevice.cpp
示例17: setupMainLayout
void CameraScreen::createUI()
{
setupMainLayout();
setupCamera();
setupButtons();
setupActivityIndicator();
arrangeWidgets();
}
开发者ID:Felard,项目名称:MoSync,代码行数:8,代码来源:CameraScreen.cpp
示例18: setupCamera
void
QvisReflectWidget::redrawScene3D(QPainter *painter)
{
setupCamera();
// This redraws the show!
setupAndDraw(painter);
}
开发者ID:burlen,项目名称:visit_vtk_7_src,代码行数:8,代码来源:QvisReflectWidget.C
示例19: setupCamera
void SliceViewer::orientationSlot( int n)
{
int ex[6];
mVolume->GetExtent(ex);
mOrientation=n;
mSliceNumber=-1;
setupCamera();
Render();
}
开发者ID:mrajchl,项目名称:hierarchicalmaxflowgui,代码行数:10,代码来源:SliceViewer.cpp
示例20: Display
void Display() {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
setupLights();
setupCamera();
drawBanana(30,cameraY+90,0);
if (coins >= 5) {
win = true;
//sound for winning
}
if (cinematic)
rotateCamera();
glColor3f(1,1,1);
Draw_Skybox(cameraX, cameraY, cameraZ, 400, 800, 400);
if (Levels.size() > 0) {
if (Levels[0].y <cameraY - 100) {
printf("deleting level");
Levels.erase(Levels.begin());
// for (int j = 0; j<Levels.size() - 1; j++) {
// Levels[j] = Levels[j + 1];
// }
// Levels.pop_back();
if (Levels.size()>0) {
Levels[0].levelBefore = NULL;
}
}
}
char result[10];
sprintf(result, "%i", coins);
//std::string name = "Score: ", result;
displayText(50, cameraY + 110, 0, 1, 1, 1, result);
if (!lost&!win) {
createScene();
character.drawCharacter();
//std::string name = "Score: ";
// char numstr[2];
/// result = name + numstr;
}
else {
if (lost)
displayText(-20, cameraY + 100, 0, 1, 1, 1, "GAME OVER!");
if (win)
displayText(-20, cameraY + 100, 0, 1, 1, 1, "YOU WON :)");
}
glFlush();
}
开发者ID:Youmna-Salah,项目名称:New-Bugs,代码行数:55,代码来源:OpenGLMeshLoader.cpp
注:本文中的setupCamera函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论