pcl+vtk (9) QVTKOpenGLNativeWidget displays point cloud and model at the same time

1. Load point cloud pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>); //Create point cloud pointer QString fileName = QFileDialog::getOpenFileName(this, “Open PointCloud”, “.”, “Open PCD files(*.pcd)”); if(fileName == “”) return; pcl::io::loadPCDFile(fileName.toStdString(),*cloud); vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New(); vtkSmartPointer<vtkCellArray> vertices = vtkSmartPointer<vtkCellArray>::New(); for (int i = 0; i<cloud->size(); i + + ) { vtkIdType pid[1]; pid[0] = points->InsertNextPoint(cloud->at(i).x, cloud->at(i).y, cloud->at(i).z); vertices->InsertNextCell(1, pid); } […]

HWUI Source Code Analysis (2) – Finally explain the ins and outs of the MVP matrix rendered by OpenGL

Overview In the process of studying the android8.1 HWUI source code, I found that OpenGL is a knowledge point that cannot be bypassed. If you do not understand the basics of OpenGL drawing, you will not be able to understand the basic principles of Hwui well. At the same time, after you are familiar with […]

Why glBegin is not defined & undefined identifier using new API (LearnOpenGL P2)

Article directory Deprecated glBegin & amp; glEnd Examples of using the new API Deprecated glBegin & amp; glEnd Environment: glfw 3.3.8 + glad core When OpenGL beginners try to use the glBegin and glEnd functions to draw triangles, they may find articles and code documents that use these functions. But many of these functions have […]

OpenGL ESRendering pipeline

1 Foreword [Rendering pipeline] refers to the graphics rendering process, which involves many concepts, including primitives, fragments, rasterization, space, transformation, clipping, shaders, fragment testing, mixing, etc. The main process of the rendering pipeline is as follows: In order to facilitate readers’ understanding of the rendering pipeline, this article will first introduce the basic concepts of […]

OpenGL LUT filter algorithm analysis

1. Introduction Filter: Some image processing software provides some simulation functions for traditional filter effects to achieve a special effect on the image. Filters usually need to be used in conjunction with channels, layers, levels, etc. to achieve the best artistic effect on the image. It is also directly called “Filter” in the software interface; […]

TransferOpenGL lighting settings

1.Set the light source (1) Type of light source Ambient Light Ambient light is a kind of light that is everywhere. Light emitted by an ambient light source is considered to come from any direction. Therefore, when you specify only ambient light for a scene, all objects will appear to be equally light and dark […]

[Transfer] OPenGL MFC drawing

1. Introduction GDI draws through the device handle (Device Context, hereinafter referred to as “DC”), while OpenGL requires a drawing environment (Rendering Context, hereinafter referred to as “RC”). Each GDI command requires a DC to be passed to it, but unlike GDI, OpenGL uses the current drawing context (RC). Once a current RC is specified […]

QTOpenGL development (1) Drawing plane graphics

Article directory draw triangle Anti-aliasing configuration Draw points, lines, quadrilaterals, polygons Draw a single point Plot multiple points Draw a straight line Draw a quadrilateral Draw polygon Draw picture texture There are many ways to implement OpenGL development in QT. The simplest and most direct way is to implement OpenGL drawing and rendering by subclassing […]

QtOpenGL development (3) shader programming

All operations in OpenGL are performed in three-dimensional space, but screens and windows are composed of two-dimensional pixels. So a large part of OpenGL’s work is to convert three-dimensional coordinate primitive information into two-dimensional pixels on the screen. In OpenGL, this three-dimensional to two-dimensional conversion process is managed by the rendering pipeline (graphics pipeline). The […]