[vtkusers] thank you for your answer!

u liu lsenlee at yahoo.com.cn
Thu Dec 7 21:35:32 EST 2006


hi,
  i use vtkBMPreader to read bmp image.to reconstuction!
  a simple win32 code:
  #include "vtkConeSource.h"
#include "vtkPolyDataMapper.h"
#include "vtkRenderWindow.h"
#include "vtkCamera.h"
#include "vtkActor.h"
#include "vtkRenderer.h"
#include"vtkBMPReader.h"
int main()
{ vtkBMPReader *cone=vtkBMPReader::New();
        cone->Allow8BitBMPOn();
 cone->SetFilePrefix("E:\\bmp2\\yu");
 cone->SetFilePattern("%s%02d.bmp");
        cone->SetDataExtent(0,379,0,260,1,13);
 cone->SetDataSpacing(1,1,50);
 cone->Update();
         vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New();
         coneMapper->SetInputConnection( cone->GetOutputPort() );
        vtkActor *coneActor = vtkActor::New();
         coneActor->SetMapper( coneMapper );
         vtkRenderer *ren1= vtkRenderer::New();
        ren1->AddActor( coneActor );
        ren1->SetBackground( 0.1, 0.2, 0.4 );
         vtkRenderWindow *renWin = vtkRenderWindow::New();
         renWin->AddRenderer( ren1 );
        renWin->SetSize( 300, 300 );
        int i;
       for (i = 0; i < 3600; ++i)
       {
        renWin->Render();//error here 
        ren1->GetActiveCamera()->Azimuth( 0.01 );
          }
  cone->Delete();
  coneMapper->Delete();
  coneActor->Delete();
  ren1->Delete();
  renWin->Delete();
    return 0;
}
  who can help me ?thanks a lot!
  newbie!

 		
---------------------------------
 雅虎免费邮箱-3.5G容量,20M附件
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061208/f01749fc/attachment.htm>


More information about the vtkusers mailing list