c# - 将光标锁定到轨迹球视图
问题描述
我有一个简单的轨迹球实现,它使用 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>
解决方案
推荐阅读
- arrays - 在 vuejs 中获取数组列
- html - 为图像缩放设置锚点?
- ios - Swift 5 让视图填满屏幕的其余部分
- bash - 如何在环境变量中使用 sed 将 ':' (冒号)替换为 ' - '(两边都有空格的连字符)?
- java - 是否可以确定openjdk的rt.jar中有哪些版本的组件?
- http - Azure 逻辑应用 -- HTTP 操作 -- POST 错误
- pytorch - 多层上的维度减少是否允许在最终表示中存储更多细节?
- java - PropertyAccessException: IllegalArgumentException 发生调用对象的 getter
- angular - 如何使用 ng2-pdf-viewer 获取 pdf 中的点击部分坐标
- r - 在循环中创建基本 R 图