当前位置:网站首页>QOpenGL显示点云文件
QOpenGL显示点云文件
2022-06-24 06:56:00 【lzfshub】
- xxx.h文件
#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
边栏推荐
- Chapter 3 curve graph of canvas
- 宝塔面板安装php7.2安装phalcon3.3.2
- Jenkins is too old try it? Cloud native ci/cd Tekton
- Easyplayerpro win configuration full screen mode can not be full screen why
- Mousse shares listed on Shenzhen Stock Exchange: gross profit margin continued to decline, and marketing failed in the first quarter of 2022
- Swift Extension ChainLayout(UI的链式布局)(源码)
- Open cooperation and win-win future | Fuxin Kunpeng joins Jinlan organization
- redolog和binlog
- Solution to the error of running NPM run eject
- SVN实测常用操作-记录操作大全
猜你喜欢

Mousse shares listed on Shenzhen Stock Exchange: gross profit margin continued to decline, and marketing failed in the first quarter of 2022

On the H5 page, the Apple phone blocks the content when using fixed to locate the bottom of the tabbar

Signature analysis of app x-zse-96 in a Q & a community

OC extension detects whether an app is installed on the mobile phone (source code)

Keep one decimal place and two decimal places

Screenshot recommendation - snipaste

GraphMAE----論文快速閱讀

软件工程导论——第二章——可行性研究

热赛道上的冷思考:乘数效应才是东数西算的根本要求

Shader common functions
随机推荐
Solution to the error of running NPM run eject
Chrono usage notes
[nilm] non intrusive load decomposition module nilmtk installation tutorial
Leetcode 515 find the leetcode path of the maximum [bfs binary tree] heroding in each row
5g industrial router Gigabit high speed low delay
Gossip: what happened to 3aC?
MySQL source and target table row count check
LeetCode练习——跳跃游戏、组合求和
On the H5 page, the Apple phone blocks the content when using fixed to locate the bottom of the tabbar
LINQ 查询(2)
1-4metasploitable2介绍
Svn actual measurement common operation record operation
Optimization and practice of Tencent cloud EMR for cloud native containerization based on yarn
Part 1: building OpenGL environment
redolog和binlog
Jenkins is too old try it? Cloud native ci/cd Tekton
Ad-gcl:advantageous graph augmentation to improve graph contractual learning
[C language] system date & time
第 3 篇:绘制三角形
Basics of reptile B1 - scrapy (learning notes of station B)