question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WPF/SharpDX PointGeometryModel3D Hittest

See original GitHub issue

Hey guys, not sure if this is really an issue or working as intenteded, let me try to explain:

I’m trying to create some kind of basic 3D modelling environment. The models consist of surfaces which are defined by their vertices. In order to display the vertices, i declared an ItemsModel3D in the view.xaml with a datatemplate using a PointGeometryModel3D. The .Geometry property is bound to the underlying models PointGeometry3D. So i’m creating one PointGeometryModel3D for each vertex i need to display.

But when i try to do hittesting on the PointGeometryModel3Ds, it’s not possible to get a result (returns null), no matter what HittestSize i’m using. I started investigating with a very basic example.

MainWindow.xaml contains the following entry for the Viewport3DX: <hx:PointGeometryModel3D Geometry="{Binding Geometry}" Color="Red" Size="5 5" IsHitTestVisible="True" HitTestThickness="{Binding HitTestThickness}" />

and in the MainViewModel there are Properties for the HitTestThickness and the Geometry. Now, using multiple different entries in Geometry.Positions (and Geometry.Indices), hittesting works (more or less good depending on camera angle and hittestsize) but the outer points of the model (again depending on camera angle) are harder to hit.

So how can i make HitTesting PointGeometryModel3D with a single position possible?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Reaper90commented, Oct 29, 2019

Sorry for the late reply, just got back to my helixtoolkit project and tried hittesting the single point PointGeometryModel, but it’s still very hard to hit those point. Since i’m still pretty new to a lot of the 3D stuff, i’m guessing i’m doing something wrong… here’s a code snippet of how i’m using it currently.

xaml: <hx:PointGeometryModel3D Geometry="{Binding PointGeometry}" Size="{Binding Size}" Color="{Binding Color}" DepthBias="-100" IsHitTestVisible="True"/>

viewmodel: PointGeometry = new PointGeometry3D() { Positiones = new Vector3Collection() { myVector3 }, Indices = new IntCollection() { 0 } }; PointGeometry.UpdateBounds();

What am i doing wrong here?

I’m also currently thinking of showing all Points in a single PointGeometryModel3D, but currently i can’t think of any way to respect all my requirements this way…

1reaction
holancecommented, Sep 10, 2019

I will fix the single point hit test issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PointGeometry3D, HelixToolkit.Wpf.SharpDX C# ...
<summary> /// Checks if the ray hits the geometry of the model. /// If there a more than one hit, result returns the...
Read more >
How to display PointGeometryModel3D using Helix.Toolkit. ...
I have a problem displaying a 3D pointcloud in my WPF application. I want to display the corner points of a 2x2x2 box,...
Read more >
Announcements · Helix Toolkit
All WPF.SharpDx model's dependency properties are using class under System ... static octree for Mesh/Point/Line/Instancing Models hit test.
Read more >
Release 2.1.0 · Helix Toolkit
All WPF.SharpDx model's dependency properties are using class under System ... static octree for Mesh/Point/Line/Instancing Models hit test.
Read more >
Gitee 极速下载/Helix-Toolkit
Fix intersecting hit test in CrossSectionMeshGeometryModel3D. (WPF.SharpDX/UWP/Core/WinUI); Fix depth peeling not working after Viewport resizing. (WPF.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found