当前位置:网站首页>Qopengl display point cloud file
Qopengl display point cloud file
2022-06-24 08:11:00 【lzfshub】
- xxx.h file
#ifndef QMYOPENGL_H
#define QMYOPENGL_H
#include <QOpenGLWidget>
#include <QOpenGLFunctions_3_3_Core>
class QMyOpenGL : public QOpenGLWidget, QOpenGLFunctions_3_3_Core
{
Q_OBJECT
public:
explicit QMyOpenGL(QWidget *parent = nullptr);
protected:
virtual void initializeGL();
virtual void resizeGL(int w, int h);
virtual void paintGL();
signals:
public slots:
};
#endif // QMYOPENGL_H
- xxx.cpp
#include "qmyopengl.h"
QMyOpenGL::QMyOpenGL(QWidget *parent) : QOpenGLWidget(parent)
{
}
void QMyOpenGL::initializeGL()
{
initializeOpenGLFunctions();
glEnable(GL_PROGRAM_POINT_SIZE);
glEnable(GL_DEPTH_TEST);
}
void QMyOpenGL::resizeGL(int w, int h)
{
}
void QMyOpenGL::paintGL()
{
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
glPointSize(5);
glBegin(GL_POINTS);
glColor3f(1.0, 1.0, 1.0);
glVertex3d(0.0f, 0.0f, 0.0f);
glEnd();
}
- pro
#-------------------------------------------------
#
# Project created by QtCreator 2022-06-20T09:51:50
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = Test3
TEMPLATE = app
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
main.cpp \
mainwindow.cpp \
qmyopengl.cpp
HEADERS += \
mainwindow.h \
qmyopengl.h
FORMS += \
mainwindow.ui
# win
LIBS += -lOpengl32 \
-lglu32
# linux
LIBS += -lglut -lGLU
边栏推荐
- Pipeline concept of graphic technology
- Installation and use of selenium IDE
- Basics of reptile B1 - scrapy (learning notes of station B)
- VsCode主题推荐
- Teach you how to use the reflect package to parse the structure of go - step 1: parameter type check
- ImportError: cannot import name ‘process_ pdf‘ from ‘pdfminer. Pdfinterp 'error completely resolved
- Leetcode 174 Dungeon games (June 23, 2022)
- 3-list introduction
- 解决错误: LNK2019 无法解析的外部符号
- Latest news of awtk: new usage of grid control
猜你喜欢

Examples of corpus data processing cases (reading multiple text files, reading multiple files specified under a folder, decoding errors, reading multiple subfolder text, batch renaming of multiple fil

C语言_字符串与指针的爱恨情仇

Écouter le réseau d'extension SWIFT (source)
![[run the script framework in Django and store the data in the database]](/img/6b/052679e5468e5a90be5c4339183f43.png)
[run the script framework in Django and store the data in the database]

Practice of opengauss database on CentOS, configuration

Installation and use of selenium IDE
![Leetcode 515 find the leetcode path of the maximum [bfs binary tree] heroding in each row](/img/16/011ba3aef1315c39526daac7e3ec89.png)
Leetcode 515 find the leetcode path of the maximum [bfs binary tree] heroding in each row

宝塔面板安装php7.2安装phalcon3.3.2

一文理解同步FIFO

Pipeline concept of graphic technology
随机推荐
JVM underlying principle analysis
June 27, 2021: given a positive array arr, it represents the weight of several people
Redolog and binlog
Cold thinking on the hot track: multiplier effect is the fundamental requirement of East West calculation
Any remarks
Echart's experience (I): about y axis yaxis attribute
Teach you how to use the reflect package to parse the structure of go - step 1: parameter type check
Simple summary of lighting usage
1279_VMWare Player安装VMWare Tools时VSock安装失败解决
5g industrial router Gigabit high speed low delay
热赛道上的冷思考:乘数效应才是东数西算的根本要求
Chapitre 2: dessiner une fenêtre
AWTK 最新动态:Grid 控件新用法
Standing at the center of the storm: how to change the engine of Tencent
How to cancel the display of the return button at the uniapp uni app H5 end the autobackbutton does not take effect
Vulnhub target: boredhackerblog_ CLOUD AV
一文理解同步FIFO
1-4metaploitable2 introduction
Vulnhub靶机:BOREDHACKERBLOG: SOCIAL NETWORK
Upgrade Mysql to the latest version (mysql8.0.25)