LiangliangNan / Easy3D

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

Scene centered by default #142

Closed jeromeAlgoFace closed 1 year ago

jeromeAlgoFace commented 1 year ago

Using the on Mac using rendering: the scene is centered by default. Is there a way to use library so that the scene is not centered?

LiangliangNan commented 1 year ago

I don't know which program you meant. If you use easy3d viewer, you can call return viewer.run(false); (at the end of your main function). The default argument value is true (i.e., int Viewer::run(bool see_all = true)), meaning all objects will be centered.

jeromeAlgoFace commented 1 year ago

I am using in composite viewer drawable->draw(cam); and cam->set_from_calibration(...) but it seems when I set camera from calibration from one frame to the other R, T are updated but not intrinsic camera K.

I think this is because I translate shape making vary cx, cy which is not at the center anymore and the system does not accept this center cx, cy not at the middle of image.

So I will find a workaround with a more usual camera. Thank you for your quick reply.

LiangliangNan commented 1 year ago

It is not clear to me your workflow. Do you call viewer.run() after setting the camera from calibration? If so, call viewer.run(false). If not, do you call viewer.fit_screen(...)?you may need to look at void Viewer::fit_screen(const easy3d::Model *model) to get a clue.

jeromeAlgoFace commented 1 year ago

Thank you for your reply. I am working to change this system I was not using the library in the usual way..

LiangliangNan commented 1 year ago

I believe this issue has been resolved so I am going to close it. Please feel free to reopen it if this is not the case.