资源简介
此程序来源于我的一篇博客,欢迎访问。
http://blog.csdn.net/gamesdev/article/details/11994501
-------------------------------------
欢迎访问我的博客。
http://blog.csdn.net/gamesdev
-------------------------------------
Qt的QWidget大家族已经成熟,不会得到太大的发展了,而随着Qt5的发展,新的界面类会崭露头角,比如QWindow、QSurface、QScreen这些类。但现在的状况(Qt5.2即将出了),这些类和模块并不会对现有的GUI模块造成威胁,更不用说取代Qt4的GUI(在Qt5是QtGui和QtWidgets)模块了。自Qt4.4起,Qt拥有了Graphics-View框架,使用这个框架可以更加轻松地在窗口中嵌入任意你想要绘制的元素。但是据我所知,Qt5的那些类无法和Graphics-View框架进行整合,对于想要利用Qt中Graphics-View框架的同行们,只能退回Qt4的类进行开发了,Qt5的这些类对于创建纯OpenGL还是有利的。
代码片段和文件信息
/* ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
* ┃ ┏━┣━┣┓ ┏┓┏┓┳┓┏━━┓┣┣━┓ ┓ ┓┣┳━┓ ┃
* ┃ ┏┏┏╯━┓┳┳━┛┏╯┃┃┃ ┃┣┣━┓┃┃ ┃┃┃ ┃
* ┃ ┃┃┏━╮┃┗┗┏╯┗┃┃╯┃ ┃┏┣━┓┃┃ ┃╯┣━┓ ┃
* ┃ ╰┫┏━┻╯┗┳┣┛┏┛┃┃┣━━┫┃┃ ┃┃┃┗╯ ┃ ┃
* ┃ ┏┫━┳━┫┏┃┣┓┗┃┃╯┃ ┃┃┃ ┃ ┃ ┃ ┣━┓ ┃
* ┃ ┗┗┗━━╯┗┛┛╯┗╯╰ ┗━━╯ ┛ ┛┗╯ ╰┛┗ ┃
* ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
* ┃ Copyright (c) 2013 jiangcaiyang ┃
* ┃ This software is provided ‘as-is‘ without any express or implied ┃
* ┃ warranty. In no event will the authors be held liable for any damages ┃
* ┃ arising from the use of this software. ┃
* ┃ ┃
* ┃ Permission is granted to anyone to use this software for any purpose ┃
* ┃ including commercial applications and to alter it and redistribute it ┃
* ┃ freely subject to the following restrictions: ┃
* ┃ ┃
* ┃ 1. The origin of this software must not be misrepresented; you must ┃
* ┃ not claim that you wrote the original software. If you use this ┃
* ┃ software in a product an acknowledgment in the product ┃
* ┃ documentation would be appreciated but is not required. ┃
* ┃ 2. Altered source versions must be plainly marked as such and must ┃
* ┃ not be misrepresented as being the original software. ┃
* ┃ 3. This notice may not be removed or altered from any source ┃
* ┃ distribution. ┃
* ┃ ┃
* ┃ jiangcaiyang jiangcaiyang123@163.com ┃
* ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
* ┃ file name: Camera.cpp ┃
* ┃ create date: 2013年9月21日星期六 20时5分30秒 ┃
* ┃ last modified date: 2013年9月24日星期二 22时12分23秒 ┃
* ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
*/
#include
#include “Camera.h“
/*---------------------------------------------------------------------------*/
Camera::Camera( void )
{
m_Pos = QVector3D( 0 0 0 );
m_RotateY = 0.0;
m_RotateH = 0.0;
m_Len = QVector3D( 0 0 0 );
m_TryPos = QVector3D( 0 0 0 );
m_TryRotateY = 0.0;
m_TryRotateH = 0.0;
m_Try = false;
}
/*---------------------------------------------------------------------------*/
void Camera::SetPos( const QVector3D pos bool _try )
{
m_Try = _try;
if ( m_Try ) m_TryPos = pos;
else
{
m_Pos += pos;
m_Offset2D += QVector3D( pos.x( ) pos.y( ) 0 );
m_TryPos = QVector3D( 0 0 0 );
}
}
void Camera::SetRotateY( float rotateY bool _try )
{
m_Try = _try;
if ( m_Try ) m_TryRotateY = rotateY;
else
{
m_RotateY +
- 上一篇:基于Qt和GLSL的着色器演示程序+源代码
- 下一篇:反向运动学演示程序含核心代码
相关资源
- 酒店管理系统基于Qt Creator5)
- OpenGL参考手册
- vtk QT做的三维地质可视化系统2of2
- Qt局域网聊天软件
- Qt Creator opengl实现四元数鼠标控制轨迹
- QT局域网聊天系统(基于QT5.修改过)
- qt-电子点菜系统
- OpenGL文档,api大全,可直接查询函数
- C 餐厅叫号系统(QT平)
- opengl轮廓字体源代码
- MFC读三维模型obj文件
- QT 实现文件下载
- qt图像处理
- 利用OpenGL写毛笔字算法
- MFC中OpenGL面和体的绘制以及动画效果
- QT,JPEG解码源代码(已完成)
- 基于OPENGL的光线跟踪源代码368758
- VC 实现三维旋转(源码)
- 自编用openGL实现3D分形树,分形山
- OpenGL球形贴图自旋程序
- Qt 播放音频文件
- OpenGL导入贴图的Texture类
- 计算机图形学(openGL)代码
- 用OpenGL开发的机械臂运动仿真程序(
- OpenGL-3D坦克模拟
- Qt 读取16进制的data文件
- MQTT+串口(usart)透传
- 易语言QQTEA算法源码
- VC工程转Qt工程文件的工具
- OPENGL实现世界上最小的3D游戏
评论
共有 条评论