• 大小: 6.24MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-25
  • 语言: 其他
  • 标签: qt  opengl  glsl  

资源简介

此程序附带了演示程序和源代码。 ------------------------------------------------- 欢迎访问我的博客: http://blog.csdn.net/gamesdev 此资源相关的博文: http://blog.csdn.net/gamesdev/article/details/10295961 http://blog.csdn.net/gamesdev/article/details/10296587 ------------------------------------------------- 我的计算机换成新的了,可以支持OpenGL2.0以及以上的规范,这样我开始正式涉足OpenGL高级的内容了。目前我的OpenGL基础库是Qt,它有完备的功能,以及对OpenGL一层好的封装,所以用它来开发基于OpenGL的应用程序非常合适。下面是我就来介绍一下如何开发基于Qt和GLSL的程序。 我制作的这个小例子还带了一个着色器编辑器。支持即时编译链接着色器,支持在GLSL规定的语法高亮,有关语法高亮的内容,感兴趣的同学可以下载一下。

资源截图

代码片段和文件信息

/* ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
 * ┃     ┏━┣━┣┓  ┏┓┏┓┳┓┏━━┓┣┣━┓ ┓ ┓┣┳━┓       ┃
 * ┃     ┏┏┏╯━┓┳┳━┛┏╯┃┃┃  ┃┣┣━┓┃┃ ┃┃┃         ┃
 * ┃     ┃┃┏━╮┃┗┗┏╯┗┃┃╯┃  ┃┏┣━┓┃┃ ┃╯┣━┓       ┃
 * ┃     ╰┫┏━┻╯┗┳┣┛┏┛┃┃┣━━┫┃┃ ┃┃┃┗╯ ┃         ┃
 * ┃     ┏┫━┳━┫┏┃┣┓┗┃┃╯┃  ┃┃┃ ┃ ┃ ┃ ┣━┓       ┃
 * ┃     ┗┗┗━━╯┗┛┛╯┗╯╰ ┗━━╯ ┛ ┛┗╯ ╰┛┗         ┃
 * ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
 * ┃                     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年8月2日星期五 14时12分49秒                           ┃
 * ┃ last modified date: 2013年8月22日星期四 22时46分0秒                    ┃
 * ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
 */
#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;
 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-08-24 23:48  bin\
     文件     6257152  2013-08-24 23:45  bin\QtShader.exe
     目录           0  2013-08-24 23:50  source\
     文件       16958  2013-08-24 23:39  source\appIcon.ico
     文件        4940  2013-08-24 23:30  source\Camera.cpp
     文件        3999  2013-08-24 23:30  source\Camera.h
     文件          55  2013-08-18 21:26  source\DefaultShader.frag
     文件         117  2013-08-19 23:42  source\DefaultShader.vert
     目录           0  2013-08-24 23:50  source\Feedback\
     文件         205  2013-08-23 22:25  source\Feedback\Feedback.pri
     文件         147  2013-08-04 19:45  source\Feedback\Feedback.qrc
     文件        4042  2013-08-24 23:32  source\Feedback\FeedbackDialog.h
     文件        2789  2013-07-12 20:40  source\Feedback\pushButtonBackground.png
     文件      100003  2013-07-12 20:34  source\Feedback\textEditBackground.png
     文件       12743  2013-08-24 23:30  source\GLWidget.cpp
     文件        4349  2013-08-24 23:30  source\GLWidget.h
     目录           0  2013-08-24 23:50  source\Icon\
     文件         138  2013-08-21 22:26  source\Icon.qrc
     文件         532  2013-08-18 21:59  source\Icon\compileIcon.png
     文件        1384  2013-08-21 22:24  source\Icon\saveIcon.png
     目录           0  2013-08-24 23:50  source\lib\
     文件      594648  2013-08-24 22:33  source\lib\libFeedback.a
     文件        3285  2013-08-24 23:30  source\main.cpp
     文件        7162  2013-08-24 23:30  source\MainWindow.cpp
     文件        3377  2013-08-24 23:30  source\MainWindow.h
     文件        3522  2013-08-24 23:45  source\QtShader_3.pro
     文件         143  2013-08-18 20:22  source\Shader.qrc
     文件        5484  2013-08-24 23:30  source\ShaderDialog.cpp
     文件        3746  2013-08-24 23:30  source\ShaderDialog.h
     文件        2470  2013-08-23 22:18  source\ShaderDialog.ui
     目录           0  2013-08-24 23:50  source\ShaderEditor\
............此处省略8个文件信息

评论

共有 条评论