maskor / qt3dpointcloudrenderer Goto Github PK
View Code? Open in Web Editor NEWAdds the ability to render generic PCLPointcloud2s and LAS/LAZ in the new Qt3D 5.8/5.9
License: GNU General Public License v3.0
Adds the ability to render generic PCLPointcloud2s and LAS/LAZ in the new Qt3D 5.8/5.9
License: GNU General Public License v3.0
This seemed like a good starting point for getting into opengl and qt, but GNU license means it can only be used in student projects since it contaminates the entire codebase making this code basically useless.
Since this isn't some super advanced, secret stuff that you later want to make a commercial and useless version of, is there a reason it can't be switched to BSD or Apache license?
Can this work with Qt5.6?
I get Qt3DPointcloudRenderer/src/qpointcloudgeometry.cpp:4:10: fatal error: 'Qt3DRender/qbufferdatagenerator.h' file not found
When I googled it though, I found an issue about that file having been called qbufferfunctor.h
in the past, but I'm not familiar with Qt to know if I can just symlink that file to the new name?
In class QPointcloudGeometryPrivate
class QPointcloudGeometryPrivate
{
public:
QPointcloudGeometryPrivate()
:m_vertexBuffer(NULL)
,m_colorBuffer(NULL)
,m_pointcloud(NULL)
,m_colorOffset(0)
,m_colorFormatUintRgba(false)
,m_colorAvailable(false)
{}
Qt3DRender::QBuffer *m_vertexBuffer;
Qt3DRender::QBuffer *m_colorBuffer;
QPointcloud *m_pointcloud;
int m_colorOffset;
bool m_colorFormatUintRgba;
bool m_colorAvailable;
};
Will the memory of QBuffer s and QPointcloud be released automatically? I don't see any delete
syntax so will they set a parent QObject implicitly? thank you for your reply
I'm building with Qt 5.12 as follows:
cd
into itmkdir build && cd build
cmake .. && make
However, when launching the produced example binary, it dies immediately with the message:
realloc(): invalid pointer
Aborted (core dumped)
gcc
version is 8.2.1
cmake
version is 3.12.1
make
version is 4.2.1
Any help would be greatly appreciated!
I fixed this by updating from the fedora repository's version of PCL to a compiled-from-source one at version 1.9.
Now I can get the application to launch but am getting errors regarding GLSL versions:
Read Pointcloud "/home/ce/Downloads/test.pcd" with 26691 points.
QOpenGLShader::compile(Vertex): 0:51(10): error: GLSL 1.50 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, 1.00 ES, and 3.00 ES
*** Problematic Vertex shader source code ***
/****************************************************************************
**
** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt3D module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#version 150 core
#define lowp
#define mediump
#define highp
#line 51
in vec3 vertexPosition;
in vec3 vertexNormal;
in vec4 vertexTangent;
in vec2 vertexTexCoord;
out vec3 worldPosition;
out vec3 worldNormal;
out vec4 worldTangent;
out vec2 texCoord;
uniform mat4 modelMatrix;
uniform mat3 modelNormalMatrix;
uniform mat4 modelViewProjection;
uniform float texCoordScale;
void main()
{
// Pass through scaled texture coordinates
texCoord = vertexTexCoord * texCoordScale;
// Transform position, normal, and tangent to world space
worldPosition = vec3(modelMatrix * vec4(vertexPosition, 1.0));
worldNormal = normalize(modelNormalMatrix * vertexNormal);
worldTangent.xyz = normalize(vec3(modelMatrix * vec4(vertexTangent.xyz, 0.0)));
worldTangent.w = vertexTangent.w;
// Calculate vertex position in clip coordinates
gl_Position = modelViewProjection * vec4(vertexPosition, 1.0);
}
Building off master ( 0e06324 ) with clang++-3.8
, Qt 5.7.0 on Ubuntu 14.04.03 I get a seg fault on exit with the example.
./Qt3DPointcloudRenderer_example
Read Pointcloud "data/bunny.pcd" with 397 points.
Read Pointcloud "data/bunny_normal.pcd" with 397 points.
[1] 22423 segmentation fault (core dumped) ./Qt3DPointcloudRenderer_example
The outputted core file tells me nothing, but I can get a little bit of info with clang's address sanitizer:
./Qt3DPointcloudRenderer_example
Read Pointcloud "data/bunny.pcd" with 397 points.
Read Pointcloud "data/bunny_normal.pcd" with 397 points.
=================================================================
==23217==ERROR: AddressSanitizer: alloc-dealloc-mismatch (malloc vs operator delete) on 0x629000064200
#0 0x51be90 in operator delete(void*) (/home/matt/workspace/qtquick/pointcloud/Qt3DPointcloudRenderer/bld/example/Qt3DPointcloudRenderer_example+0x51be90)
#1 0x7f75d32c33c8 (/opt/Qt5.7.0/5.7/gcc_64/lib/libQt53DRender.so.5+0x15e3c8)
#2 0x7f75d32c33f2 (/opt/Qt5.7.0/5.7/gcc_64/lib/libQt53DRender.so.5+0x15e3f2)
#3 0x7f75d31f67d5 (/opt/Qt5.7.0/5.7/gcc_64/lib/libQt53DRender.so.5+0x917d5)
#4 0x7f75d31f40cf in Qt3DRender::Render::NodeManagers::~NodeManagers() (/opt/Qt5.7.0/5.7/gcc_64/lib/libQt53DRender.so.5+0x8f0cf)
#5 0x7f75d325649a in Qt3DRender::QRenderAspectPrivate::~QRenderAspectPrivate() (/opt/Qt5.7.0/5.7/gcc_64/lib/libQt53DRender.so.5+0xf149a)
#6 0x7f75d32565f8 in Qt3DRender::QRenderAspectPrivate::~QRenderAspectPrivate() (/opt/Qt5.7.0/5.7/gcc_64/lib/libQt53DRender.so.5+0xf15f8)
#7 0x7f75c83aa1f5 in QObject::~QObject() (/opt/Qt5.7.0/5.7/gcc_64/lib/libQt5Core.so.5+0x2a11f5)
#8 0x7f75d3256258 in Qt3DRender::QRenderAspect::~QRenderAspect() (/opt/Qt5.7.0/5.7/gcc_64/lib/libQt53DRender.so.5+0xf1258)
#9 0x7f75c83a364f in QObject::event(QEvent*) (/opt/Qt5.7.0/5.7/gcc_64/lib/libQt5Core.so.5+0x29a64f)
#10 0x7f75c837a989 in QCoreApplication::notify(QObject*, QEvent*) (/opt/Qt5.7.0/5.7/gcc_64/lib/libQt5Core.so.5+0x271989)
#11 0x7f75c837aadf in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/opt/Qt5.7.0/5.7/gcc_64/lib/libQt5Core.so.5+0x271adf)
#12 0x7f75c837d51a in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (/opt/Qt5.7.0/5.7/gcc_64/lib/libQt5Core.so.5+0x27451a)
#13 0x7f75c81b3806 (/opt/Qt5.7.0/5.7/gcc_64/lib/libQt5Core.so.5+0xaa806)
#14 0x7f75c81b4600 (/opt/Qt5.7.0/5.7/gcc_64/lib/libQt5Core.so.5+0xab600)
#15 0x7f75c78db183 in start_thread /build/eglibc-oGUzwX/eglibc-2.19/nptl/pthread_create.c:312
#16 0x7f75c6fe537c in clone /build/eglibc-oGUzwX/eglibc-2.19/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:111
0x629000064200 is located 0 bytes inside of 16384-byte region [0x629000064200,0x629000068200)
allocated by thread T3 (Qt3DCore::QAspe) here:
#0 0x4ed818 in __interceptor_malloc (/home/matt/workspace/qtquick/pointcloud/Qt3DPointcloudRenderer/bld/example/Qt3DPointcloudRenderer_example+0x4ed818)
#1 0x7f75d32b86b8 (/opt/Qt5.7.0/5.7/gcc_64/lib/libQt53DRender.so.5+0x1536b8)
Thread T3 (Qt3DCore::QAspe) created by T0 here:
#0 0x456b8d in pthread_create (/home/matt/workspace/qtquick/pointcloud/Qt3DPointcloudRenderer/bld/example/Qt3DPointcloudRenderer_example+0x456b8d)
#1 0x7f75c81b3ba8 in QThread::start(QThread::Priority) (/opt/Qt5.7.0/5.7/gcc_64/lib/libQt5Core.so.5+0xaaba8)
SUMMARY: AddressSanitizer: alloc-dealloc-mismatch (/home/matt/workspace/qtquick/pointcloud/Qt3DPointcloudRenderer/bld/example/Qt3DPointcloudRenderer_example+0x51be90) in operator delete(void*)
==23217==HINT: if you don't care about these errors you may set ASAN_OPTIONS=alloc_dealloc_mismatch=0
==23217==ABORTING
(not really an issue..)
I added a method to add to the QPointcloud. Not sure if you're interested. If so, I can send a pull request?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.