【问题标题】:Click Event not working anymore when using Helixtoolkit.SortingVisual3D使用 Helixtoolkit.SortingVisual3D 时单击事件不再起作用
【发布时间】:2021-07-23 02:31:58
【问题描述】:

我想为对象添加透明度(不丢失点击事件)。 谷歌让我试试 SortingVisual3D。 如果没有 SortingVisual3D,一切(透明度除外)都可以正常工作,点击事件也可以。

现在我尝试实现它(简化代码):

Public SV3d As New HelixToolkit.Wpf.SortingVisual3D
Public Model3DUI As New ModelUIElement3D

'Apply geometry
    Model3DUI.Model = geometry 'skipped geometry code in this post
'Add Click Event
    AddHandler Model3DUI.MouseLeftButtonUp, AddressOf ClickEvent
'Add to SortingVisual3D
    SV3d.Children.Add(Model3DUI)
'Add to ViewPort
    Viewport.Children.Add(SV3d)
'Setup SortingVisual3D
    SV3d.SortingFrequency = 2
    SV3d.Method = HelixToolkit.Wpf.SortingMethod.BoundingBoxCorners
    SV3d.IsSorting = True

基本上它工作正常,一切都按原样呈现,透明度也能正常工作。但由于某种原因,现在点击事件不起作用。 有人知道我做错了什么吗?

我对 Helixtoolkit 不是很有经验,所以可能是我的方式完全错误。

【问题讨论】:

  • 我遇到了同样的问题。我试图找到解决方案,但结果与使用 SortingVisual3D 相同。如果你解决了问题,分享解决方案是个好主意!
  • 嘿@ZoranZoki,不幸的是我仍然没有解决方案:(

标签: wpf vb.net click helix-3d-toolkit helix


【解决方案1】:

首先创建SortingVisual3D,然后在开头添加可视可点击对象,最后添加透明对象,命中测试可见设置为false!这对我有用!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-12
    • 2016-05-26
    • 1970-01-01
    • 2018-11-11
    • 1970-01-01
    相关资源
    最近更新 更多