Closed cuong-nguyen closed 3 months ago
You should check out Viewpoint.GetViewpoint()
and Viewpoint.SetViewpoint()
as documented here. There's a working example here
Essentially this creates a BCF representation of the current state of model, which can be used to restore the viewer state later. As it's just a JSON structure you can store the viewpoint however you like before recalling it.
Thank you for a quick reply.
I should have mentioned that I am still on the xViewer
not the latest Viewer (I have to maintain the app) and Viewpoint does not exist. Is it possible to achieve same thing with xViewer?
You should just be able to store and recall the matrix/camera settings to achieve something similar. I think they were called mvMatrix and pMatrix on the xViewer
You should just be able to store and recall the matrix/camera settings to achieve something similar. I think they were called mvMatrix and pMatrix on the
xViewer
Appreciate it. I will give it a try.
Hi, I am new to the library and not sure what to do. I have a model which contains building (with doors, windows,...) I want to be able to select any of them and then zoom in on them which I can achieve. But now I need to go back to previous state before zooming (on a button clicked). Can you share how would I do that?
Before zoom
After zoom (click on yellow part above)
Thanks.