Hitdetection problem
#3
As I set the Active model I do the following:

Reset the events on the eventManager
Code:
_eventManager.ResetEventSources3D();

Get the event from the Active model and register it.
Code:
var eventSourceToRegister = _dictionarySceneObjectToEventSource[sceneObject.Key];
_eventManager.RegisterEventSource3D(eventSourceToRegister);

Thanks in advance!

PS: I have to say this:

If I draw the "Wireframe" I also draw A solid TransparentMesh with it to do Polygon hit detection with some of my own code.

This is how to Model is realy build:

Code:
var myModel3DGroup = new Model3DGroup();

                    //Solid
                    _solidModel = new GeometryModel3D
                    {
                        Geometry = GetMeshGeometry(roughModel.MeshBoundary.TriangleMesh),
                        Material = new DiffuseMaterial(Brushes.Transparent)
                    };
                    myModel3DGroup.Children.Add(_solidModel);

                    //WireFrame
                    _edges = model.MeshBoundary.PolygonMesh.GetEdgeList();
                    
                    _wireframeModelGroup = new Model3DGroup();
                    var model1 = Line3DFactory.CreateMultiLine3D(model1Edges, 0.5, Color, LineCap.Flat, LineCap.Flat, ViewPort);
                    _wireframeModelGroup.Children.Add(model1);

                    myModel3DGroup.Children.Add(_wireframeModelGroup);
  


Messages In This Thread
Hitdetection problem - by daageu - 12-12-2013, 01:00 PM
RE: Hitdetection problem - by abenedik - 12-12-2013, 01:39 PM
RE: Hitdetection problem - by daageu - 12-12-2013, 01:59 PM
RE: Hitdetection problem - by abenedik - 12-12-2013, 02:26 PM
RE: Hitdetection problem - by daageu - 12-12-2013, 02:37 PM
RE: Hitdetection problem - by abenedik - 12-12-2013, 02:46 PM
RE: Hitdetection problem - by daageu - 12-12-2013, 04:04 PM
RE: Hitdetection problem - by abenedik - 12-12-2013, 04:12 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)