当前位置:网站首页>Getting started with QT & OpenGL
Getting started with QT & OpenGL
2022-07-28 18:59:00 【Days_ It's not on yet】
Catalog
8、 ... and 、 Matrix transformation
Introduction chapter
One 、 Window building

Add the style

add to OpenGL Area

Create a new class Convenient for OpenGLwidget The operation of . Inherited classes can be changed

Control promotion

add to , Choose promote

Two 、 Draw triangle
triangle graphic data





After binding Drawing
glDrawArrays(GL_TRIANGLES,0,6); // from 0 Start looking for 6 A little bit

3、 ... and 、 Compile and connect fixed-point shaders
Before drawing figures Using shaders ,VBO Actual stored data ,VAO Store a series of operations

Index buffer object EBO

Switch to 4 A little bit





stay EBO After binding Then untie VAO

VAO Record EBO Unbind operation Cannot draw , but VAO Don't record VBO Unbundling
Four 、 Interaction control





The interface already has You also need to call

Change the drawing style

5、 ... and 、QT External use Shaders


Coding rule settings

Include header file

link 
The difference in use

Delete EBO 
6、 ... and 、 Shader explanation
Assembly line Input and output




Input and output
Rely on the name Transfer data on the pipeline , Fixed point shaders Pass to Fragment Shader 
Fixed point shaders

layout (location = 0) in vec3 aPos; Indexes


inquiry apos Location

Binding method Location


uniform




If not called resize paint When to quit Will report a mistake 
Multiple attributes 0=position 1=color

glVertexAttribPointer(); // Offset





7、 ... and 、 Texture loading

Tell the triangle that a certain point needs to be loaded Which point of the texture pattern



Texture units 0


QT It's encapsulated You can use it directly QT encapsulation 


When adding textures VAO Final unbinding Easy to record

The channel is 0 So binding 0 
Add a reddening effect



Loading of multiple textures


CPU End separation 
Activate the channel 1

Texture wrapping




Texture filtering

8、 ... and 、 Matrix transformation





Rotate first and then move , Zoom in first and then shift 
The vertices In the shader 




Nine 、 Coordinate system

Ten
...
边栏推荐
- What if svchost.exe of win11 system has been downloading?
- MYSQL入门与进阶(九)
- Three minutes to understand, come to new media
- 408 review strategy (strengthening stage)
- N32 replaces STM32. Don't ignore these details!
- The open source of "avoiding disease and avoiding medicine" will not go far
- C# 之 观察者模式实例 -- 订牛奶
- Is software testing really as good as online?
- Introduction and advanced MySQL (7)
- [actual combat] realize page distortion correction with OpenCV
猜你喜欢

Redis缓存雪崩、穿透、击穿,布隆过滤器,分布式锁详解

Win11电脑摄像头打开看不见,显示黑屏如何解决?

MYSQL入门与进阶(六)

现代化个人博客系统 ModStartBlog v5.4.0 登录界面改版,新增联系方式
![[actual combat] realize page distortion correction with OpenCV](/img/7b/7e25bde34a9d5463af3dd40599c80e.png)
[actual combat] realize page distortion correction with OpenCV

Interviewer: what are the usage scenarios of ThreadLocal? How to avoid memory leakage?

我的创作纪念日 -- 2022年7月25日

配置教程:新版本EasyCVR(v2.5.0)组织结构如何级联到上级平台?

How to use the white list function of the video fusion cloud service easycvr platform?

Today in history: Microsoft acquires qdos; Model testing pioneer birth; The first laser typesetting Chinese newspaper
随机推荐
Redis cache avalanche, penetration, breakdown, bloom filter, detailed explanation of distributed lock
MYSQL入门与进阶(九)
Kotlin:Sealed class密封类详解
redis持久化之RDB和AOF的区别
Software testing dry goods
什么样的知识付费系统功能,更有利于平台与讲师发展?
2022年中国企业服务产业市场行情
redis优势以及数据结构相关知识
The login interface of modern personal blog system modstartblog v5.4.0 has been revised and the contact information has been added
2022-07-27 study notes of group 4 self-cultivation class (every day)
数字经济时代的开源数据库创新 | 2022开放原子全球开源峰会数据库分论坛圆满召开
EasyCVR新版本级联时,下级平台向上传递层级目录显示不全的原因分析
LeetCode_ 1137_ Nth teponacci number
How to adjust the brightness of win11? Four methods of adjusting screen brightness in win11
The switching language of unity causes an error: system FormatException:String was not recognized as a valid DateTime.
Introduction and advanced MySQL (7)
Configuration tutorial: how does the organizational structure of the new version of easycvr (v2.5.0) cascade to the superior platform?
MYSQL入门与进阶(一)
LeetCode_ 63_ Different paths II
使用自开发的代理服务器解决 SAP UI5 FileUploader 上传文件时遇到的跨域访问错误试读版