@stevebaer thank you for your quick reply and apologies for my late reply!
Thanks for the sample - it proved quite useful even though I am not running rhino within a standalone wpf app. I cloned the repo, build and ran the above sample to see if it has the same issue as my version and it does. Whenever I am scrolling to zoom, the XYZ axis is being transformed while zooming out:
Of curse, this does not happen when opening rhino itself.
I looked at the camara properties on a normal rhino file and when zooming, all of the following values change:
When I subscribed to the MouseWheel event and set a debug breakpoint to check the same values, they dont change, their values are always constant. So I guess that is where the problem lies.
private void ViewportControl_MouseWheel(object sender, MouseEventArgs e)
{
var camaraLocation = _viewportControl.Viewport.CameraLocation;
var camaraTarget = _viewportControl.Viewport.CameraTarget;
var camaraX = _viewportControl.Viewport.CameraX;
var camaraY = _viewportControl.Viewport.CameraY;
var camaraZ = _viewportControl.Viewport.CameraZ;
}
How can I guarantee the same behavior like in rhino? Is there something else that has to be done?
@stevebaer the main issue we’re having has been lost in the thread. Just to restate the main issue:
We have scrolling and zooming issues which appear to be related to viewport scaling - could it be caused by the fact we’re running this app in Revit as a add-in and use RiR to convert Revit elements into BReps and there is some mismatch between the how the two applications handle geometry in its unit environment? We really need to find a solution to this problem.
In summary:
The camera focal distance is extreme which results in peculiar effects when rotating the model - like an extreme fisheye.
When the grid is displayed in the embedded viewport it appears much smaller relative to the geometry compared to outputting the same geometry directly into Rhino (1000x smaller by estimate).
The XYZ axis animation (bottom left of viewport) has odd length axes in the embedded viewport but they are all equal when viewing the animation in the Rhino application.