First, the dynamic display mechanism is primarily (if not fully) meant for drawing “feedback”, it’s not meant for drawing objects that you want hanging around longer than a given command, which is what it looks like you want in your case.
Second, the “terrain” geometry/mesh should be getting drawn as part of the “object drawing” phase, if you want it to participate in any/all depth buffering calculations.
Third, any/all other type of drawing (i.e. the terrain editing cursor) should get drawn in the dynamic drawing phase, as it seems like it always wants to draw “on top” of the terrain, and it’s part of some editing command.
Given that, I would draw all meshes and wires inside the post object drawing phase, and I would draw all terrain editing tools/icons/cursors etc… inside the dynamic drawing (the one you’re using now).
Note: Keeping a feedback/overlay conduit or a GetObject object hanging around just to draw something is going to be somewhat of a performance drain (and IMO quite heavy handed), as they always cause a frame update…even the slightest mouse move will generate a call to the dynamic drawing mechanism…so if you’re drawing heavy meshes or objects, then you can/will eventually bring Rhino to its knees just by moving the mouse. The “object drawing phases” only get executed if/when something has actually changed the projection or frustum, an object state change, or if some command has forced an entire redraw of the document.
We may need to reword the comments for the post object drawing, because I think it’s confusing the real meaning and functionality.
The disappearing act is somewhat of a mystery, but for now I will attribute it to improper use of the dynamic drawing mechanism. If after you make the simple changes suggested above, you’re still seeing things disappear, then I’ll probably want to see your plugin, or a small example that easily reproduces and demonstrates the problem.
Lastly…this is more of a side note, but I want to make sure it’s clear… What you’re seeing is not “transparency” occurring…you’re seeing all the wires getting drawn on top of all polygons, giving the perception that they’re “showing through” the mesh…but if you look more closely at the actual mesh, it’s still opaque (i.e. you can’t see portions of the mesh that lie behind other portions of the mesh). I only mention this because knowing and understanding this can help you diagnose possible future situations that have similar results.
Hope this helps.
-Jeff