您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ updateProjectionMatrix函数代码示例

51自学网 2021-06-03 09:14:16
  C++
这篇教程C++ updateProjectionMatrix函数代码示例写得很实用,希望能帮到您。

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

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

示例1: abs

void PlotCartesianWidget::mouseMoveEvent(QMouseEvent *event){    int dx = event->x() - lastPos.x();    int dy = event->y() - lastPos.y();    // control+left adjusts the x-scale of the graph    if( event->buttons() & Qt::LeftButton && event->modifiers() & Qt::ControlModifier )    {        int d = abs(dx) > abs(dy) ? dx : dy;        scaleX += float(d) * scaleX * 0.05;        scaleX = std::max<float>( scaleX, 0.01 );        scaleX = std::min<float>( scaleX, 50.0 );        updateInputDataLineVAO();        updateViewMatrix();    }    // control+right adjusts the x-scale of the graph    else if( event->buttons() & Qt::RightButton && event->modifiers() & Qt::ControlModifier )    {        int d = abs(dx) > abs(dy) ? dx : dy;        scaleY += float(d) * scaleY * 0.05;        scaleY = std::max<float>( scaleY, 0.01 );        scaleY = std::min<float>( scaleY, 50.0 );        updateAxisVAO();        updateViewMatrix();    }    // left mouse button adjusts the viewing dir    else if (event->buttons() & Qt::LeftButton)    {        float xScalar = 1.0 / float(width()*devicePixelRatio());        float yScalar = 1.0 / float(height()*devicePixelRatio());        float maxScalar = std::max( xScalar, yScalar );        centerX += float(-dx)*maxScalar*2.0*lookZoom;        centerY += float( dy)*maxScalar*2.0*lookZoom;        updateProjectionMatrix();        updateInputDataLineVAO();    }    // right mouse button adjusts the zoom    else if (event->buttons() & Qt::RightButton)    {        // use the dir with the biggest change        int d = abs(dx) > abs(dy) ? dx : dy;        lookZoom -= float(d) * lookZoom * 0.05;        lookZoom = std::max<float>( lookZoom, 0.01f );        lookZoom = std::min<float>( lookZoom, 50.0f );        updateAxisVAO();        updateInputDataLineVAO();        updateProjectionMatrix();    }    lastPos = event->pos();    // redraw    updateGL();}
开发者ID:wdas,项目名称:brdf,代码行数:60,


示例2: window

void QGLView::updatePerspectiveAspectRatio(){    qreal ratio;    int w;    int h;    if (window() != NULL) {        ratio = window()->devicePixelRatio();    }    else {        ratio = 1.0f;    }    w = int(ratio * this->width());    h = int(ratio * this->height());    if ((w > 0) && (h > 0)) // avoid division by zero    {        m_projectionAspectRatio = (float)w/(float)h;    }    else {        m_projectionAspectRatio = 1.0f;    }    updateProjectionMatrix();}
开发者ID:hekav,项目名称:QtQuickVcp,代码行数:26,


示例3: updateProjectionMatrix

void CamtransCamera::setAspectRatio(float a){    // @TODO: [CAMTRANS] Fill this in...    m_aspectRatio = a;    updateProjectionMatrix();}
开发者ID:lygood2008,项目名称:CodingSample,代码行数:7,


示例4: m_type

Camera::Camera(const Type& type): m_type(type), m_position(Vec3::zero), m_right(Vec3::xxx), m_up(Vec3::yyy), m_front(Vec3::zzz), m_upFovDegrees(0.0f), m_aspectRatio(0.0f), m_rightMin(0.0f), m_rightMax(0.0f), m_upMin(0.0f), m_upMax(0.0f), m_frontMin(0.0f), m_frontMax(0.0f), m_preViewMatrix(Mat4::identity), m_viewMatrix(Mat4::identity), m_orthographicProjectionMatrix(Mat4::identity), m_perspectiveProjectionMatrix(Mat4::identity), m_viewOrthographicProjectionMatrix(Mat4::identity), m_viewPerspectiveProjectionMatrix(Mat4::identity), m_postProjectionMatrix(Mat4::identity) {    updateViewMatrix();    updateProjectionMatrix();    updateViewProjectionMatrix();	updateFrustumPlanesAndPoints();}
开发者ID:ardneran,项目名称:Framework,代码行数:26,


示例5: updateProjectionMatrix

// resizevoid Camera::ResizeWindow(int w, int h){    this->m_width = w;    this->m_height = h;    updateProjectionMatrix();}
开发者ID:f-YoshiHiro,项目名称:dss-cloth,代码行数:8,


示例6: updateOrientation

void Projector::update(){    if(!m_pkCamera)        return;    updateOrientation();    updateModelViewMatrix();    updateProjectionMatrix();    float16 kViewPrj = m_kModelViewMatrix * m_kProjectionMatrix;    float16 kInvViewPrj = inverse(kViewPrj);        findFrustumCorners(m_akFrustum, kInvViewPrj);    m_uiIntersectionCount = findPlanarIntersections(m_akIntersections, m_akFrustum);    if(m_uiIntersectionCount > 0)    {        m_kRange = findProjectedRange(m_uiIntersectionCount, m_akIntersections, kViewPrj);        findProjectedCorners(m_akCorners, m_kRange, kInvViewPrj);        updateRangeMatrix(m_kRange);        m_bIsVisible = true;    }    else    {        m_bIsVisible = false;    }}
开发者ID:fruitsamples,项目名称:OpenCL_OceanWave,代码行数:27,


示例7: updateModelViewMatrix

void CamtransCamera::orientLook(const Vector4 &eye, const Vector4 &look, const Vector4 &up){    // @TODO: [CAMTRANS] Fill this in...    m_n = look;    m_n = m_n.getNormalized();    m_n *= (-1);    m_n.unhomgenize();    REAL uProjection = m_n.dot( up );    m_v.x = up.x - uProjection*m_n.x;    m_v.y = up.y - uProjection*m_n.y;    m_v.z = up.z - uProjection*m_n.z;   m_v =  m_v.getNormalized();    m_v.unhomgenize();    m_u = m_v;    m_u = m_v.cross(m_n);    m_u.unhomgenize();    m_eyePosition = eye;    m_lookAt = look;    m_up = up;    REAL lN = m_lookAt.getMagnitude();    m_lookAt /= lN;    m_lookAt.unhomgenize();    m_up = m_v;    m_up.unhomgenize();    updateModelViewMatrix();    updateProjectionMatrix();}
开发者ID:lygood2008,项目名称:CodingSample,代码行数:34,


示例8: updateProjectionMatrix

void Camera::perspective(float nFov, float nAspect, float nNear, float nFar) {	fov = nFov;	aspect = nAspect;	near = nNear;	far = nFar;	projection_type = PERSPECTIVE;	updateProjectionMatrix();}
开发者ID:arneboon,项目名称:roxlu,代码行数:8,


示例9: windowSizeUpdated

int windowSizeUpdated(unsigned int newWidth , unsigned int newHeight){   fprintf(stderr,"Window size changed to %u x %u/n",newWidth,newHeight);   WIDTH=newWidth;   HEIGHT=newHeight;   updateProjectionMatrix();   return 1;}
开发者ID:AmmarkoV,项目名称:RGBDAcquisition,代码行数:8,


示例10: updateProjectionMatrix

 void Camera::orthoTopLeft(float nWidth, float nHeight, float nNear, float nFar) {   ortho_width = nWidth;   ortho_height = nHeight;   n = nNear;   f = nFar;   projection_type = ORTHO_TOP_LEFT;   updateProjectionMatrix(); }
开发者ID:basseyndon,项目名称:roxlu_experimental,代码行数:8,


示例11: updateProjectionMatrix

glm::mat4 Camera::getCameraMatrix(){	if( projectionChanged ){		updateProjectionMatrix();	}	if( eyeChanged ){		updateCameraMatrix();	}	return camera;}
开发者ID:DustinCraggs,项目名称:SpaceBoat,代码行数:9,


示例12: updateProjectionMatrix

/* Render::setSize: set size */void Render::setSize(int w, int h){   if (m_width != w || m_height != h) {      if (w > 0)         m_width = w;      if (h > 0)         m_height = h;      updateProjectionMatrix();   }}
开发者ID:shirayukikitsune,项目名称:xbeat,代码行数:11,


示例13: updateProjectionMatrix

 void RenderingManager::processChangedSettings(const Settings::CategorySettingVector &changed) {     for (Settings::CategorySettingVector::const_iterator it = changed.begin(); it != changed.end(); ++it)     {         if (it->first == "General" && it->second == "field of view")         {             mFieldOfView = Settings::Manager::getFloat("field of view", "General");             updateProjectionMatrix();         }         else if (it->first == "Camera" && it->second == "viewing distance")         {             mViewDistance = Settings::Manager::getFloat("viewing distance", "Camera");             mStateUpdater->setFogEnd(mViewDistance);             updateProjectionMatrix();         }         else if (it->first == "General" && (it->second == "texture filtering" || it->second == "anisotropy"))             updateTextureFiltering();     } }
开发者ID:fmwviormv,项目名称:openmw,代码行数:19,


示例14: position

Camera::Camera(vec3 pos, float horiAngle, float vertAngle, float aspectRatio, float fovy, float viewDistance) :	position(pos){	this->verticalAngle = vertAngle;	this->horizontalAngle = horiAngle;	this->aspect = aspectRatio;	this->fovy = fovy;	this->viewDistance = viewDistance;	updateViewMatrix();	updateProjectionMatrix();}
开发者ID:Grevor,项目名称:OSM2-Particle-System,代码行数:11,


示例15: Camera

 OrthographicCamera::OrthographicCamera(float _left, float _right, float _top, float _bottom, float _near, float _far)   : Camera(),     left(_left),     right(_right),     top(_top),     bottom(_bottom),     near(_near),     far(_far) {   updateProjectionMatrix(); }
开发者ID:wibbe,项目名称:three-cpp,代码行数:11,


示例16: updateProjectionMatrix

void Camera::setFrustum(const float& rightMin, const float& rightMax, const float& upMin, const float& upMax, const float& frontMin, const float& frontMax) {	m_rightMin = rightMin;	m_rightMax = rightMax;	m_upMin = upMin;	m_upMax = upMax;	m_frontMin = frontMin;	m_frontMax = frontMax;	updateProjectionMatrix();	updateViewProjectionMatrix();	updateFrustumPlanesAndPoints();}
开发者ID:ardneran,项目名称:Framework,代码行数:11,


示例17: updateProjectionMatrix

void Camera::setResolution(glm::vec2 resolution){    resX = resolution.x;    resY = resolution.y;        updateProjectionMatrix();        m_aspectRatio = resX / resY;    m_rasterBounds = Bounds2i( glm::vec2 ( -resX / 2.0, -resY / 2.0 ), glm::vec2 ( resX / 2.0, resY / 2.0 ) );    m_area = sensorArea();}
开发者ID:JonCG90,项目名称:GraphicsEngine,代码行数:11,


示例18: updateProjectionMatrix

void SpatialCamera::setFrustum(const float& l, const float& r, const float& b, const float& t, const float& n, const float& f) {	m_projectionParameters.l = l;	m_projectionParameters.r = r;	m_projectionParameters.b = b;	m_projectionParameters.t = t;	m_projectionParameters.n = n;	m_projectionParameters.f = f;	updateProjectionMatrix();	updateViewProjectionMatrix();	updateFrustumPlanesAndPoints();}
开发者ID:ardneran,项目名称:Sandbox,代码行数:11,


示例19: setPosition

// Reset the camera back to its defaultsvoid Camera::reset(){    setPosition(glm::vec3(0.0, 0.0, 0.5));    lookAt(glm::vec3(0.0, 0.0, -1.0), glm::vec3(0.0, 1.0, 0.0));    fieldOfView_   = 45.0f;         // frustrum viewing aperture    aspectRatio_   = 4.0f / 3.0f;   // frustrum view angling    nearFieldClip_ = 0.005f;        // clip anything closer than this    farFieldClip_  = 65536.0f;         // clip anything farther than this    updateProjectionMatrix();}
开发者ID:Jesse-V,项目名称:Folding-Atomata,代码行数:12,


示例20: updateViewMatrix

void Camera::set(){	updateViewMatrix();	updateProjectionMatrix();	glMatrixMode( GL_MODELVIEW );	glLoadMatrixf( view_matrix.m );	glMatrixMode( GL_PROJECTION );	glLoadMatrixf( projection_matrix.m );	glMatrixMode( GL_MODELVIEW );}
开发者ID:abeldella,项目名称:JocsElectronics,代码行数:11,


示例21: setViewOffset

	void setViewOffset (T fullWidth, T fullHeight, T x, T y, T width, T height){		this->fullWidth = fullWidth;		this->fullHeight = fullHeight;		this->x = x;		this->y = y;		this->width = width;		this->height = height;		updateProjectionMatrix();	}
开发者ID:MyUPlay,项目名称:MyEngine,代码行数:11,


示例22: updateProjectionMatrix

void Camera::setPerspective(float fov, float aspect, float near_plane, float far_plane){	type = PERSPECTIVE;	this->fov = fov;	this->aspect = aspect;	this->near_plane = near_plane;	this->far_plane = far_plane;	//update projection	updateProjectionMatrix();}
开发者ID:abeldella,项目名称:JocsElectronics,代码行数:12,


示例23: setPosition

// Reset the camera back to its defaultsvoid Camera::reset(){    auto startPos = glm::vec3(0, -1, 0);    setPosition(startPos);    lookAt(glm::vec3(0, 0, 0), glm::vec3(0, 0, 1));    translate(-startPos);    fieldOfView_   = 45.0f;         // frustrum viewing aperture    aspectRatio_   = 4.0f / 3.0f;   // frustrum view angling    nearFieldClip_ = 0.005f;        // clip anything closer than this    farFieldClip_  = 65536.0f;      // clip anything farther than this    updateProjectionMatrix();}
开发者ID:Jesse-V,项目名称:Multibrot-3D,代码行数:14,


示例24: tanf

void SpatialCamera::setFrustum(const float& upFovRadian, const float& aspectRatio, const float& n, const float& f) {	m_upFovRadian = upFovRadian;	m_aspectRatio = aspectRatio;	m_projectionParameters.n = n;	m_projectionParameters.f = f;	m_projectionParameters.t = n * tanf(0.5f * upFovRadian);	m_projectionParameters.r = aspectRatio * m_projectionParameters.t;	m_projectionParameters.b = -m_projectionParameters.t;	m_projectionParameters.l = -m_projectionParameters.r;	updateProjectionMatrix();	updateViewProjectionMatrix();	updateFrustumPlanesAndPoints();}
开发者ID:ardneran,项目名称:Sandbox,代码行数:13,



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


C++ updateRect函数代码示例
C++ updatePreview函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。