0

scrollwheel zoom stops on large scene

Anonymous 10 years ago 0
This discussion was imported from CodePlex

mihaipruna wrote at 2014-08-17 17:53:

on a scene that spans a wider expanse of xy space,with multiple features, I cannot zoom in on a feature as much as when that feature was by itself. The scrollwheel simply stops zooming in, but the panning distance when dragging the mouse keeps decreasing, so it looks like your camera is "stuck"
Is there a way to enable more zoom on a bigger scene?

mihaipruna wrote at 2014-08-19 17:26:

I figured it out based on another post here:
private void hv_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
        {
           
            if (hv.Camera.LookDirection.Length >= 800 && e.Delta < 0)
            {
                Vector3D vava = hv.Camera.LookDirection;
                vava = Vector3D.Multiply(800 / vava.Length, vava);
                hv.Camera.LookDirection = vava;
            }

            if (hv.Camera.LookDirection.Length <= 1 && e.Delta > 0)
            {
                Vector3D vava = hv.Camera.LookDirection;
                vava.Normalize();
                hv.Camera.LookDirection = vava;
            }
        }