CRhinoDisplayConduit question

I have a question when using CRhinoDisplayConduit.
I using CRhinoDisplayConduit to display the arrow (ON_Brep object) below:

when I rotate the view, the surface mesh cover the arrow.

I want the arrow always be front of view.
How to do?

I setup CDisplayPipelineMaterial as below:

CDisplayPipelineMaterial m_display_pm;
m_display_pm.m_FrontMaterial = RhinoApp().AppSettings().DefaultMaterial();
m_display_pm.m_FrontMaterial.SetTransparency( 0 );

Thank you

I’ve just found this. Maybe interesting for you:


Under the last example is the following text:

This piece of code draws a coloured, c-plane axis system ON TOP of all 
objects. Because I disable DepthWriting and Testing prior to drawing my 
points and arrows, my objects are not obscured by the existing geometry 
(which was drawn in a channel previous to PostDrawObjects.

Thank for your help.

I tried this function.
It is not work.

void CSetForceBCDlg::DrawVirtualMovingDirection( CRhinoDisplayPipeline& dp )
	int iCount = m_pDisplayBasePointArray->GetCount();
	for ( int i=0; i<iCount; i++ )
		dp.DrawShadedBrep( m_pConeBrep[i], &m_display_pm);
		dp.DrawShadedBrep( m_pCylinderBrep[i], &m_display_pm);

I think you need to use the correct channel to draw, maybe SC_DRAWFOREGROUND or SC_POSTDRAWOBJECTS

In the example they use:

protected override void PreDrawObjects(DrawEventArgs e)

What channel are you trying your arrow in?

When and where to draw ON_Breps highly depends on the desired effect.

If you’re drawing wireframes that you always want on top, then you should probably draw them in the SC_DRAWFOREGROUND channel.

If you’re drawing shaded objects, then you’ll probably want to draw them in either the SC_PREDRAWOBJECTS or SC_POSTDRAWOBJECTS channel. However, if transparency is involved, then you’ll have to draw them in SC_POSTDRAWOBJECTS in order for all other objects to “show through” your transparent ones.

Basically, all of the DRAWOBJECT channels support depth buffered drawing, and doing any kind of drawing anywhere else will not have or support depth buffering.

Hope this helps.

It is wrong channel in my code.
I used SC_DRAWBACKGROUND to draw the arrow.
Now, I use SC_DRAWFOREGROUND to draw.
It works.

Thank for your help.