首页 > 解决方案 > 将光标锁定到轨迹球视图

问题描述

我有一个简单的轨迹球实现,它使用 C# 中的 HelixViewport3D 通过鼠标移动旋转球体。

我需要锁定光标的移动以紧密匹配球体的旋转,以便光标的 x 和 y 上的移动将紧密匹配轨迹球的旋转。目前,轨迹球的旋转速度要快得多。我一直在调整旋转灵敏度,但我想知道是否有更好的解决方案。

  <Window x:Class="HelixTest.MainWindow" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:h="http://helix-toolkit.org/wpf"
        Title="Getting Started Demo" Height="500" Width="500">

    <h:HelixViewport3D x:Name="ViewPort" 
                       CameraRotationMode="Trackball" 
                       IsZoomEnabled="False" 
                       IsTouchZoomEnabled="False" 
                       IsPanEnabled="False"
                       IsInertiaEnabled="True" 
                       RotationSensitivity="0.11"
                       ShowViewCube="False" 
                       ShowFrameRate="False" 
                       ShowCameraInfo="True"
                       ShowCameraTarget="False">
        <h:DefaultLights/>
        <h:SphereVisual3D x:Name="Ball"  Radius="9.4" Fill="#FF802121"/>
    </h:HelixViewport3D>
    </Window>

标签: c#

解决方案


推荐阅读