[vtkusers] vtkCaptionActor2D question about rendering order

Ben Held ben.held at staarinc.com
Mon Dec 23 14:54:13 EST 2002


I am using the following code snippet to add a caption to a point.  It works
fine, except that the caption text is rendered behind the 3D geometry that
is rendered most of the time.  I am adding the vtkCaptionActor2D to the
renderer last.  Any ideas?  I have tried the SetLayerNumber and that doesn't
seem to have any effect.

	if (!m_pSnapToActor2D) {
		m_pSnapToActor2D = vtkCaptionActor2D::New();
		CString str;
		str.Format("(%G, %G, %G)", pdPoint[0], pdPoint[1], pdPoint[2]);
		m_pSnapToActor2D->SetCaption(str);
		m_pSnapToActor2D->BorderOff();
		m_pSnapToActor2D->ThreeDimensionalLeaderOn();

		m_pSphereGlyph = vtkSphereSource::New();
		m_pSphereGlyph->SetPhiResolution(100);
		m_pSphereGlyph->SetThetaResolution(100);

		m_pSnapToActor2D->SetLeaderGlyph(m_pSphereGlyph->GetOutput());
		m_pSnapToActor2D->SetLeaderGlyphSize(0.025);
		m_pSnapToActor2D->SetMaximumLeaderGlyphSize(10.0);
		m_pSnapToActor2D->SetWidth(0.25);
		m_pSnapToActor2D->SetHeight(0.05);


Ben Held
Simulation Technology & Applied Research, Inc.
11520 N. Port Washington Rd., Suite 101B
Mequon, WI  53092
P: +1 (262) 240-0291 x101
F: +1 (262) 240-0294
W: http://www.staarinc.com





More information about the vtkusers mailing list