LiangliangNan / Easy3D

A lightweight, easy-to-use, and efficient C++ library for processing and rendering 3D data
GNU General Public License v3.0
1.37k stars 245 forks source link

Allow the user to change the default rendering parameters #122

Closed KenKenhehe closed 2 years ago

KenKenhehe commented 2 years ago

Is there a way to turn off the reflection when visualizing point cloud data with normal? The large green section I would like them to show a solid green colour rather than parts of it become white due to lighting, is it possible ?

LiangliangNan commented 2 years ago

Yes. This parameter can be changed here: https://github.com/LiangliangNan/Easy3D/blob/7f620280d6346568c5bbee7b1487e8ac7dcd851c/easy3d/renderer/setting.cpp#L60

It is now hard-coded as default values. In the next release, I will make it (and many other default parameters) accessible to users. This month is too busy with other stuff.

LiangliangNan commented 2 years ago

@KenKenhehe Now easy3d allows storing rendering parameters into a file and loading them from the setting file on program startup. After updating the code, all you need to do is to add a line of code at the beginning of your main() function. So the main function will look like this:

#include <easy3d/renderer/setting.h>

int main(int argc, char *argv[])
{
    logging::initialize(true, true, true, "default", 9);
    setting::initialize("default"); // <-------- This is the new line
    ...
}

After running the program, a setting file like "MyApp.ini" will be created next to the executable file. Then you can use any text editor to modify the rendering parameters in this file, and it will take effect the next time when you start the program.

And of course, you can also directly modify some of these default parameters in <easy3d/renderer/setting.cpp>.

KenKenhehe commented 2 years ago

This is awesome! Thanks for being so active in the open source community!