当前位置:网站首页>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
边栏推荐
- C语言_字符串与指针的爱恨情仇
- The monthly salary of two years after graduation is 36K. It's not difficult to say
- Upgrade Mysql to the latest version (mysql8.0.25)
- These dependencies were not found: * core JS / modules / es6 array. Fill in XXX
- Chapter 3: drawing triangles
- 【资料上新】迅为基于3568开发板的NPU开发资料全面升级
- MySQL source and target table row count check
- 蓝桥杯_N 皇后问题
- Solve the problem of notebook keyboard disabling failure
- 单片机STM32F103RB,BLDC直流电机控制器设计,原理图、源码和电路方案
猜你喜欢
随机推荐
Installation and use of selenium IDE
[测试开发]初识软件测试
Standing at the center of the storm: how to change the engine of Tencent
Live wire, neutral wire and ground wire. Do you know the function of these three wires?
Swift Extension NetworkUtil(网络监听)(源码)
Open cooperation and win-win future | Fuxin Kunpeng joins Jinlan organization
Pagoda panel installation php7.2 installation phalcon3.3.2
快速读论文----AD-GCL:Adversarial Graph Augmentation to Improve Graph Contrastive Learning
LeetCode练习——跳跃游戏、组合求和
第 2 篇:绘制一个窗口
Swift extension networkutil (network monitoring) (source code)
How to design a highly available and extended image storage function
Swift 基础 Swift才有的特性
GraphMAE----論文快速閱讀
Mousse shares listed on Shenzhen Stock Exchange: gross profit margin continued to decline, and marketing failed in the first quarter of 2022
Screenshot recommendation - snipaste
Redolog and binlog
Optimization and practice of Tencent cloud EMR for cloud native containerization based on yarn
Backup and restore SQL Server Databases locally
JS implementation to check whether an array object contains values from another array object









