0

Mouse Click

Anonymous 5 years ago updated by Ardahan 4 years ago 2
This discussion was imported from CodePlex

chimou wrote at 2013-06-06 11:09:

Hello,
In my scene I have some cylinder and I want to select one of them by clicking on.

Thank you in advance

objo wrote at 2013-06-08 07:32:

Try to use a ModelUIElement3D, then you can handle MouseDown events
http://msdn.microsoft.com/en-us/library/system.windows.uielement3d.mousedown.aspx

The idea is to treat the UI Element as a parent view and contain the model(s) within it? Then the UI Element handles mouse interaction?

If you still looking for answer I have found a hit testing method a couple of days ago and it works to me perfectly.

Like you do, I am select one model from among of many model and color it differently from others.

The solution is here;

http://csharphelper.com/blog/2014/10/perform-hit-testing-in-a-3d-program-that-uses-wpf-xaml-and-c/#comment-181625