Easy3D icon indicating copy to clipboard operation
Easy3D copied to clipboard

Allow the user to change the default rendering parameters

Open KenKenhehe opened this issue 2 years ago • 1 comments

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 ?

KenKenhehe avatar May 31 '22 01:05 KenKenhehe

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 avatar May 31 '22 08:05 LiangliangNan

@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>.

LiangliangNan avatar Oct 11 '22 14:10 LiangliangNan

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

KenKenhehe avatar Oct 13 '22 04:10 KenKenhehe