Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gvaliente/q3dobserver
Multi-platform C++11 library based on Qt for creating 3D viewer widgets
https://github.com/gvaliente/q3dobserver
3d cpp11 opengl qt5
Last synced: 3 months ago
JSON representation
Multi-platform C++11 library based on Qt for creating 3D viewer widgets
- Host: GitHub
- URL: https://github.com/gvaliente/q3dobserver
- Owner: GValiente
- License: zlib
- Created: 2018-10-02T22:44:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-09-17T23:13:00.000Z (over 5 years ago)
- Last Synced: 2023-10-19T18:46:53.237Z (over 1 year ago)
- Topics: 3d, cpp11, opengl, qt5
- Language: C++
- Homepage:
- Size: 94.7 KB
- Stars: 22
- Watchers: 5
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Q3DObserver
===========Q3DObserver is a multi-platform C++11 library based on Qt that eases the creation of 3D viewer widgets.
Q3DObserver provides some of the typical 3D viewer functionalities, such as an orbit camera which can be rotated, scaled and translated using the mouse. Based on the Qt toolkit, it compiles on any architecture (Unix-Linux, Mac, Windows). Q3DObserver does not display 3D scenes in various formats, but it can be the base for the coding of such a viewer.
Q3DObserver is licensed under [Zlib license](LICENSE.txt). OpenGL knowledge is NOT required to use this library.
![screenshot of some 3D shapes rendered with Q3DObserver](screenshot.png?raw=true)
## Tested build configurations (minimum required versions may be lower)
* Ubuntu 16.04 with gcc 4.9.
* and macOS 10.11 with Xcode 8.2.
* and Windows 7 with Visual Studio 2017.
* CMake 3.4.
* Qt 5.5.## Building and running tests on Linux and Mac
```
cd q3dobserver
mkdir build
cd build
cmake -DQ3DO_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release ..
make
./tests/q3dobserver-tests
```## Main features
* Show 3D figures such as points, lines, triangles and text strings without writing OpenGL code.
* Orbit camera which can be rotated, scaled and translated using the mouse.
* Open source commercial friendly license (Zlib): compatible with open and closed source projects.## Usage
The following example shows how to draw some 3D figures:
```cpp
// main.cpp:#include
#include "Q3DObserver"int main(int argc, char** argv)
{
QApplication app(argc, argv);// Enable antialiasing:
QSurfaceFormat format;
format.setSamples(4);
QSurfaceFormat::setDefaultFormat(format);// Create widget and add 3D figures:
Q3DObserver observer;
observer.addPoint(QVector3D(0, 0, 0), QColor(Qt::red));
observer.addLine(QVector3D(-1, -1, -1), QVector3D(1, 1, 1), QColor(Qt::green));
observer.addTriangle(QVector3D(0, 1, 0), QVector3D(1, 0, 0), QVector3D(-1, 0, 0), QColor(Qt::blue));
observer.addText(QVector3D(0, 0.5, 0), QColor(Qt::white), "3D text");// Show widget:
observer.resize(1280, 720);
observer.show();return QApplication::exec();
}
```