当前位置:网站首页>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
边栏推荐
- [nilm] non intrusive load decomposition module nilmtk installation tutorial
- Solve the problem of notebook keyboard disabling failure
- Vulnhub target: boredhackerblog: social network
- Swift 基础 Swift才有的特性
- 没有专业背景,还有机会成为机器学习工程师吗?
- L1-019 who goes first (15 points)
- Model effect optimization, try a variety of cross validation methods (system operation)
- The first exposure of Alibaba cloud's native security panorama behind the only highest level in the whole domain
- Introduction to software engineering - Chapter 2 - feasibility study
- 第 2 篇:绘制一个窗口
猜你喜欢

Specify IP when calling feign interface

SCM stm32f103rb, BLDC DC motor controller design, schematic diagram, source code and circuit scheme

Chapter 3: drawing triangles

Coordinate transformation of graphic technology

有关iframe锚点,锚点出现上下偏移,锚点出现页面显示问题.iframe的srcdoc问题

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

Pagoda panel installation php7.2 installation phalcon3.3.2

Écouter le réseau d'extension SWIFT (source)

How to cancel the display of the return button at the uniapp uni app H5 end the autobackbutton does not take effect

没有专业背景,还有机会成为机器学习工程师吗?
随机推荐
auto使用示例
Chapter 3 curve graph of canvas
Part 2: drawing a window
Pagoda panel installation php7.2 installation phalcon3.3.2
热赛道上的冷思考:乘数效应才是东数西算的根本要求
Cold thinking on the hot track: multiplier effect is the fundamental requirement of East West calculation
C# Lambda
Redolog and binlog
Four models of iPhone 13 series have been exposed, and indeed, they are 13 fragrant!
On the H5 page, the Apple phone blocks the content when using fixed to locate the bottom of the tabbar
快速读论文----AD-GCL:Adversarial Graph Augmentation to Improve Graph Contrastive Learning
Swift 基础 Swift才有的特性
Simple summary of lighting usage
Graphmae - - lecture rapide des documents
JDBC 在性能测试中的应用
Decltype usage introduction
Swift Extension NetworkUtil(网络监听)(源码)
Atguigu---15- built in instruction
Backup and restore SQL Server Databases locally
单片机STM32F103RB,BLDC直流电机控制器设计,原理图、源码和电路方案