WPF/SharpDX PointGeometryModel3D Hittest
See original GitHub issueHey 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:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
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…
I will fix the single point hit test issue.