This app is part of a project that is conducted at the Computer Graphics Laboratory, Department of Computer Science, Ben-Gurion University, Israel.
In this project, a cloud that consists of millions of points in 3D space are rendered on screen. The input file ("pointcloud") is a proprietary file of a commercial company, and is the result of a high-accuracy laser scanner.
On this scene, 3D objects (defined in .stl
format) are rendered. The company provides for each object a transformation that defines its location in relation to local space (the laser scanner is situated at this space's origin).
The final step is to dynamically define an epsilon-environment (via a simple slider). Each point from the cloud that is in the epsilon-environment of the STL
will be rendered, so the end result is a scene that consists of STL
s with points superimposed. This will enable future applications in the field of machine learning.
A summary f the project can be read in the file Final Report - Topics in computer graphics.pdf
.
This project is intended to run on Windows. It is tested and functioning properly on Windows 10.
- Visual Studio 2015
- PCL 1.7.2
- OpenFrameworks
Since the app is written in VS2015, it has an attached .vcxproj
file that manages its Configuration. In order for the compiler and linker to execute properly, the following environment variables should be define:
PCL_ROOT
- PCL's installation root. This is set during the installation of PCL.OPEN_FRAMEWORKS
- set it manually to point to OF's installation root.
- In the window
Property Manager
, open the properties ofDebug | x64
. On the left side, paste intoC/C++ -> Additional Include Directories
the following:
$(PCL_ROOT)\3rdParty\Boost\include\boost-1_57;
$(PCL_ROOT)\include\pcl-1.7;
$(PCL_ROOT)\3rdParty\FLANN\include;
$(PCL_ROOT)\3rdParty\Eigen\eigen3;
$(PCL_ROOT)\3rdParty\VTK\include\vtk-6.2;
%(AdditionalIncludeDirectories);
$(OPEN_FRAMEWORKS)\addons\ofxAssimpModelLoader\libs;
$(OPEN_FRAMEWORKS)\addons\ofxAssimpModelLoader\libs\assimp;
$(OPEN_FRAMEWORKS)\addons\ofxAssimpModelLoader\libs\assimp\include;
$(OPEN_FRAMEWORKS)\addons\ofxAssimpModelLoader\libs\assimp\include\assimp;
$(OPEN_FRAMEWORKS)\addons\ofxAssimpModelLoader\libs\assimp\include\assimp\Compiler;
$(OPEN_FRAMEWORKS)\addons\ofxAssimpModelLoader\libs\assimp\lib;
$(OPEN_FRAMEWORKS)\addons\ofxAssimpModelLoader\libs\assimp\lib\emscripten;
$(OPEN_FRAMEWORKS)\addons\ofxAssimpModelLoader\libs\assimp\lib\vs;
$(OPEN_FRAMEWORKS)\addons\ofxAssimpModelLoader\libs\assimp\lib\vs\Win32;
$(OPEN_FRAMEWORKS)\addons\ofxAssimpModelLoader\libs\assimp\lib\vs\x64;
$(OPEN_FRAMEWORKS)\addons\ofxAssimpModelLoader\libs\assimp\license;
$(OPEN_FRAMEWORKS)\addons\ofxAssimpModelLoader\src;
$(OPEN_FRAMEWORKS)\addons\ofxGui\src
-
Under
General-> Project Defaults
, setCharacter Set
toNot Set
. -
Under
Linker -> Additional Library Directories
, paste:
$(OPEN_FRAMEWORKS)\addons\ofxAssimpModelLoader\libs\assimp\lib\vs\x64;
$(PCL_ROOT)\3rdParty\;
$(PCL_ROOT)\lib;
%(AdditionalLibraryDirectories)
- Drag-n-drop the file
PCL.props
intoDebug | x64
in the property manager. This will make the file the 5th property sheet underDebug | x64
. Open it, and paste the following toC/C++ -> Additional Include Directories
:
$(PCL_ROOT)\include\pcl-1.7;
$(PCL_ROOT)\3rdParty\Boost\include\boost-1_57;
$(PCL_ROOT)\3rdParty\Eigen\eigen3;
$(PCL_ROOT)\3rdParty\FLANN\include;
$(PCL_ROOT)\3rdParty\QHull\include;
$(PCL_ROOT)\3rdParty\VTK\include\vtk-6.2;
%(AdditionalIncludeDirectories)
- ...and the following to
Linker -> Additional Library Directories
:
$(PCL_ROOT)\lib;
$(PCL_ROOT)\3rdParty\Boost\lib;
$(PCL_ROOT)\3rdParty\FLANN\lib;
$(PCL_ROOT)\3rdParty\QHull\lib;
$(PCL_ROOT)\3rdParty\VTK\lib;
%(AdditionalLibraryDirectories)
-
Furthermore, the project should be launched from within VS2015 in
x64, Debug
configuration. -
Add to the file
$(OPEN_FRAMEWORKS)\addons\ofxAssimpModelLoader\src\ofxAssimpModelLoader.h
the following method declaration:
void updateMatrix(ofMatrix4x4 mat);
- ...and add its implementation to the file
$(OPEN_FRAMEWORKS)\addons\ofxAssimpModelLoader\src\ofxAssimpModelLoader.cpp
:
void ofxAssimpModelLoader::updateMatrix(ofMatrix4x4 mat) {
modelMatrix.makeFromMultiplicationOf(modelMatrix, mat);
}
- You'll have to change some hard-coded paths in certain files in order for this to work properly:
Object3dModel.h
ofApp.h
ofApp.cpp
- Cloud input files are assumed to be in
.gszf
format. - Cultural models transformation files are assumed to be in
.csv
format, and their actual content in a certain format. - Same goes for the transformation files that depict the clouds' transformations from local spaces to global space.
- Load the app.
- Wait 1-2 minutes for all of the transformation files and cultural models to be loaded.
- Load a cloud, this takes 1-2 minutes.
- You can change the camera's orientation with the mouse while left-clicking.
- You can move the camera's position with w-a-s-d like in an FPS game. You can move the camera up\down with W\S and pan it counter\clockwise with A\D.
3 cloud rendered concurrently, bird's-eye view Cloud and models vs. Google Earth Street level view, note the benches ...and without benches: an example of model category filtration per user reqeuest.
The app is based on Natan Elul's original project, with assistance from Fanglin Gu.
The MIT License (MIT)
Copyright (c) 2016 Asaf Chelouche, Ben Ben-Chaya
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.