[vtkusers] vtkVectorText or vtkFollower Bug

ahmed Tokalak tokalak at web.de
Fri Mar 22 18:47:31 EST 2002


I send the complete code:

import vtk.*;

public class FollowerTest {

  // in the static contructor we load in the native code
  // The libraries must be in your path to work
  static { 
      System.loadLibrary("vtkJava"); 
  }

  // the main function
  public static void main (String[] args)
  {
      vtkVectorText atext = new vtkVectorText();
      atext.SetText("VectorText");
      vtkPolyDataMapper followMapper = new vtkPolyDataMapper();
      followMapper.SetInput(atext.GetOutput());
      vtkFollower followActor = new vtkFollower();
      followActor.SetMapper(followMapper);
      followActor.SetScale( 0.1, 0.1, 0.1);
      followActor.GetProperty().SetColor( 1, 0.2, 0.2);
      // followActor.AddPosition(0, 0, 0);

      // a renderer for the data
      vtkRenderer ren1 = new vtkRenderer();
      
      ren1.AddActor(followActor);	
      
      ren1.GetActiveCamera().Zoom(1.6);
      ren1.ResetCameraClippingRange();
      followActor.SetCamera(ren1.GetActiveCamera());
      ren1.SetBackground(1,1,1); // background color white
      
      // a render window to display the contents
      vtkRenderWindow renWin = new vtkRenderWindow();
      renWin.AddRenderer(ren1);
      renWin.SetSize(300,300);
      
      // an interactor to allow control of the objects
	vtkRenderWindowInteractor iren = new vtkRenderWindowInteractor();
	iren.SetRenderWindow(renWin);
	
	// trigger the rendering and start the interaction
	renWin.Render();
	iren.Start();
  }
}

//end of code

"ahmed Tokalak" <tokalak at web.de> schrieb am 21.03.02:
> I also executed your code (VText.java) but it still shows nothing but the exit-Button. I see a black area where the text should be.
> 
> "Randy Heiland" <heiland at ncsa.uiuc.edu> wrote:
> > Ahmed,
> > 
> > I don't have any problem with your code - the text gets displayed.  You didn't
> > indicate which version of VTK you're using.  Nor did you include your entire
> > Java pgm.  I'm using 4.0 and I attached the Java pgm I used to test this
> > (simply using /VTK/Wrapping/Java/SimpleVTK.java as a template).  Also, don't
> > forget to include:
> >     System.loadLibrary("vtkHybridJava");
> > 
> > in vtkPanel.java since that's where vtkVectorText is.  But I assume you would
> > have got an error otherwise.
> > 
> > --Randy
> > 
> > 
> > 
> > On Mar 21, 11:56am, ahmed Tokalak wrote:
> > > Subject: [vtkusers] vtkVectorText or vtkFollower Bug
> > > Hi Everybody,
> > >
> > > I use vtkVectorText to show text-labels but nothing is visible. Any idea?
> > This is my code:
> > >
> > > vtkVectorText atext = new vtkVectorText();
> > > atext.SetText("Test");
> > > vtkPolyDataMapper followMapper = new vtkPolyDataMapper();
> > > followMapper.SetInput(atext.GetOutput());
> > > vtkFollower followActor = new vtkFollower();
> > > followActor.SetMapper(followMapper);
> > > followActor.SetScale( 0.2, 0.2, 0.2);
> > > followActor.GetProperty().SetColor( 1, 0.2, 0.2);
> > > followActor.SetPosition(0, -0.2, 0);
> > >
> > > renderer.AddActor(followActor);
> > 



______________________________________________________________________________
Seien Sie dabei und sichern Sie sich 100% Leistung, 100% Prämie und 
100% Zufriedenheit. Jetzt unter http://club.web.de/?mc=021105




More information about the vtkusers mailing list