hittest

ARKit estimatedVerticalPlane hit test get plane rotation

杀马特。学长 韩版系。学妹 提交于 2019-12-10 10:17:01
问题 I am using ARKit to detect walls at runtime, I use a hit test of type .estimatedVerticalPlane when some point of the screen is touched. I am trying to apply Y rotation to node corresponding to the detected plane orientation. I want to compute the rotation in : private func computeYRotationForHitLocation(hitTestResult: ARHitTestResult) -> Float { guard hitTestResult.type == .estimatedVerticalPlane else { return 0.0 } // guard let planeAnchor = hitTestResult.anchor as? ARPlaneAnchor else {

Hit Testing in WPF

倾然丶 夕夏残阳落幕 提交于 2019-12-08 19:14:27
问题 I have an Ellipse on a Canvas and I'm doing Hit Testing on it. Every time I click the stroke of the Ellipse , the test passes. If I click in the middle of the Ellipse , the test fails. This is good! After I fill the ellipse like this: myEllipse.Fill = new SolidColorBrush(Colors.Blue); , the test pasess also when I click in the middle of the Ellipse . How can I disable this? (even when Ellipse is Filled, the test will fail when I click in the middle) Thanks ! 回答1: If you do your own hit

hitTestObject on child of a MC

筅森魡賤 提交于 2019-12-08 17:06:27
I have a MC called 'playerP" and inside of it with 7 different MC. I can't seems to hit test on the children MC, it always show [object position_2] private function cMove(e:MouseEvent):void { trace(MovieClip(playerP.RR), playerP.PT) if (e.currentTarget.hitTestObject(playerP.PT)) { trace("hit la"); } } Try explicitly iterating through the children. private function cMove(e:MouseEvent):void { for (var ii : uint = 0; ii < playerP.numChildren; ++ii) { if (e.currentTarget.hitTestObject(playerP.getChildAt(ii))) { trace("hit la"); } } } FJW I am trying to reference a movieclip that has 2 layers and 2

In SpriteKit, how is zPosition used for rendering and for hit tests?

馋奶兔 提交于 2019-12-08 13:52:21
问题 Edit: Apple fixed this in iOS8, so it was certainly not expected/intended but a bug. It appears that the zPosition is interpreted differently when used for rendering a node vs when used for determining which node is touched. When I create a hierarchy of parent and childnodes (all with zPosition set), the topmost node for rendering is determined by the summation of all zPositions leading to the node, so nodes from different parents can be interleaved. When determining the topmost node for

3D Hit Testing in WPF

让人想犯罪 __ 提交于 2019-12-08 01:36:43
问题 I'm writing a WPF application that displays terrain in 3D. When I perform hit testing, the wrong 3D point is returned (not the point I clicked on). I tried highlighting the triangle that was hit (by creating a new mesh, taking the coordinates from the RayMeshGeometry3DHitTestResult object). I see that the wrong triangle gets hit (a triangle is highlighted, but it is not under the cursor). I'm using a perspective camera with field of view of 60, and the near and far planes are of 3 and 35000

Show series value over any point on chart using tooltip c#

左心房为你撑大大i 提交于 2019-12-08 01:32:13
问题 So I've seen lots of examples on using tooltip to show chart data when hovering over a data point, but I was hoping to show the values when my mouse is simply over the chart and not necessarily over a particular data point (i.e. the whitespace everywhere else). I would also eventually like to have a small circle or square on the data point itself but that can come later. Can anyone tell me how to do this? I will include my current code below. private void chData_MouseMove(object sender,

Hit Test behavior

守給你的承諾、 提交于 2019-12-07 20:20:56
问题 I have the following code public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } List<UIElement> ucs = new List<UIElement>(); private void Window_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { ucs.Clear(); Point p = e.GetPosition((UIElement)sender); VisualTreeHelper.HitTest(this, null, new HitTestResultCallback(MyHitTestCallback), new PointHitTestParameters(p)); Console.WriteLine("ucs.Count = {0}", ucs.Count); foreach (var item in ucs) {

HitTest across Windows?

为君一笑 提交于 2019-12-07 01:06:04
问题 Ok, so my previous question did not produce any useful answers, so I'll try to come from a different direction. My application has, potentially, several windows. Given a point in screen coordinates, I need to find which window it "falls" onto - i.e. find the Window that is foremost of all windows containing said point. If they were Visual s inside one window, I would use VisualTreeHelper.HitTest . But since they are different windows, it's not clear what to give as the first argument to that

3D Hit Testing in WPF

时间秒杀一切 提交于 2019-12-06 12:45:10
I'm writing a WPF application that displays terrain in 3D. When I perform hit testing, the wrong 3D point is returned (not the point I clicked on). I tried highlighting the triangle that was hit (by creating a new mesh, taking the coordinates from the RayMeshGeometry3DHitTestResult object). I see that the wrong triangle gets hit (a triangle is highlighted, but it is not under the cursor). I'm using a perspective camera with field of view of 60, and the near and far planes are of 3 and 35000 respectively. Any idea why it might happen and what I can do to solve it? Let me know if you need any

Show series value over any point on chart using tooltip c#

我的梦境 提交于 2019-12-06 09:31:54
So I've seen lots of examples on using tooltip to show chart data when hovering over a data point, but I was hoping to show the values when my mouse is simply over the chart and not necessarily over a particular data point (i.e. the whitespace everywhere else). I would also eventually like to have a small circle or square on the data point itself but that can come later. Can anyone tell me how to do this? I will include my current code below. private void chData_MouseMove(object sender, MouseEventArgs e) { HitTestResult pos = chData.HitTest(e.X, e.Y); if (pos.ChartElementType ==