[vtkusers] camera

Renaud Isabelle renauisa at yahoo.fr
Fri May 27 16:02:34 EDT 2005


Hi Luis, 
 
I followed your advice and tried to create my own class to display my image with VTK. 
 
However, as Ì'm still new to VTK, I'm not familiar with all this notions of camera, actor, mapper and so on. I tried to set up my own parameters  of a camera. However, I succed to view only a part of my image 1552*128.
 
Here is what I did:  
 
  m_Camera        = vtkCamera::New();
  m_Actor         = vtkImageActor::New();
  m_Renderer      = vtkRenderer::New();
  m_RenderWindow  = vtkRenderWindow::New();
 
  //setup the pipeline
  m_Renderer->AddActor( m_Actor );
  m_RenderWindow->AddRenderer( m_Renderer ); 
 
  // The usual rendering stuff
  m_Camera->ComputeViewPlaneNormal();
  m_Camera->SetViewUp (0, 0, -1);
  m_Camera->SetPosition(0,0,1);
  m_Camera->SetFocalPoint(0,0,0);
  m_Camera->ParallelProjectionOn(); 
 
  m_Renderer->SetActiveCamera(m_Camera);
  m_Renderer->ResetCamera();
  m_Renderer->SetBackground(0,0,0); //set a background color  
 
   m_Actor->SetInput( image)
   m_Camera->SetClippingRange( 0.1, 1000.);
   m_RenderWindow->Render();
 
Do you think one or several parameters are not correct and explain my result, If so, could you tell me which one.
 
Isabelle

Luis Ibanez <luis.ibanez at kitware.com> a écrit :

Hi Isabelle,

In order to have more control over the rendering of the image
you should replace the vtkImageViewer class with the individual
components used in ImageSliceViewer, namely:


vtkImageActor * m_Actor;
vtkRenderer * m_Renderer;
vtkCamera * m_Camera;
vtkRenderWindow * m_RenderWindow;



The vtkImageViewer is actually a grouping of

vtkRenderWindow *RenderWindow;
vtkRenderer *Renderer;
vtkImageMapper *ImageMapper;
vtkActor2D *Actor2D;
vtkRenderWindowInteractor *Interactor;
vtkInteractorStyleImage *InteractorStyle;


into a single class, just for convenience of use.
http://www.vtk.org/doc/nightly/html/classvtkImageViewer.html

Regards,

Luis
		
---------------------------------
 Découvrez le nouveau Yahoo! Mail : 1 Go d'espace de stockage pour vos mails, photos et vidéos !
Créez votre Yahoo! Mail  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050527/324db5be/attachment-0001.htm>


More information about the vtkusers mailing list