xBimTeam / XbimWindowsUI

The home of XbimXplorer and WPF components for your desktop BIM applications.
Other
245 stars 149 forks source link

Camera ZoomFactor Management in Xbim Xplorer #217

Open CCT-Mukund-Thakare opened 3 weeks ago

CCT-Mukund-Thakare commented 3 weeks ago

@andyward I am curious and interested in knowing, How Xbim Xplorer is managing zoom factor based for different sizes of models (small, large), so that we get smooth zooming in and zooming out behavior ? I had very smooth zooming-in and zooming-out experience for both large and small models. For large models, When camera is far away from viewer, zoom factor is be large, hence when we zoom-in camera speedily zoom's to the model. And as camera starts getting close to model the zoom factor starts getting smaller and smaller so that it smoothly reach the model. How is Xbim Xplorer is managing this zoom factor so that, we get the smooth feeling of zoom in and zoom out.

Is camera zoom factor based on the distance between camera and model ? Like when camera is far away then zoom factor is large and when it is closer the zoom factor is small, it this the idea behind it ?

Or is it based on the size of the bounding box ? Like when bounding box is larger then zoom factor is large and when bounding box is smaller then zoom factor is small.

Let me know your thoughts on this. Will be happy to know the idea you had used to manage this behavior.

Thank you !!

andyward commented 3 weeks ago

I'm not that familiar with the Windows UI code base - @CBenghi may be have a more authorative answer. I know in WebUI we handle the relative zooming ourselves, but I suspect in Xplorer we're delegating it to the underlying Helix3D WPF control See Here. This is a bit more sophisticated as it includes concepts such as inertia.

CCT-Mukund-Thakare commented 3 weeks ago

@andyward Thank you for the link. Also, How do you guys handle relative zooming in WebUI ?

Thank you !!