I am drawing a dynamic moving vehicle like this:
m_dynamicSymbolProperties.set_DynamicGlyph(esriDynamicSymbolType.esriDSymbolMarker, this.bluePoliceCarGlyph);
m_dynamicSymbolProperties.SetScale(esriDynamicSymbolType.esriDSymbolMarker, .3f, .3f);
currentUnitPosition = getNextPosition();
dynamicDisplay.DrawMarker(currentUnitPosition);
Does anyone know an easy way to do a hit test on my vehicle? I am having trouble with this code example, http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/How_to_identify_objects_in_dynamic_display/0001000004s2000000/
One of the issues I have with the example is that ESRI states:
ArcGIS versions 9.2 and later have the following three display systems that use OpenGL as their underlying drawing pipe—ArcGlobe/GlobeControl, ArcScene/SceneControl, and MapControl's dynamic display.
So I am trying to get a hit test for a dynamic display object, but according to the tutorial, part 1 (link above), I have to use the OpenGL display system to give my dynamic display object a watermark in order for the hit test to work. This makes no sense at all.
uint ID = Convert.ToUInt32(r[0]);
OpenGL.GL.glLoadName(ID);
Another issue I have is when this code is called
IArray dynamicHitArray = m_dynamicDisplay.Locate(x, y,
esriDynamicSelectionMode.esriDSMLayers, this as IDynamicLayer);
Another event is fired off to DrawDynamicLayer and I will get a stackoverflow unless I do this
if(!someBool)
{
someBool = true;
IArray dynamicHitArray = m_dynamicDisplay.Locate(x, y,
esriDynamicSelectionMode.esriDSMLayers, this as IDynamicLayer);
someBool = false;
}