[vtkusers] about vtkMarchingCubes

zhao yong qiang zhao-yq at cs.sjtu.edu.cn
Mon Mar 31 10:51:40 EST 2003


Hi all,

    I read several BMP files. Then I want to use vtkMarchingCubes to
display it in 3d view. But the view seems the position is not right, the
left of image and the right are upside-down.

The following is the code:

vtkBMPReader* reader = vtkBMPReader::New();

  reader->SetFilePrefix("f:\\temp\\00013E9A");

  reader->SetDataExtent(0,255,0,255,1,9);

  reader->SetDataOrigin(0,0,0);

  reader->SetDataSpacing(1,1,3);

 

  vtkMarchingCubes* iso = vtkMarchingCubes::New();

  iso->SetInput(reader->GetOutput());

  iso->GenerateValues(4,0,255);

  iso->ComputeGradientsOn();

  iso->ComputeScalarsOff();

 

vtkPolyDataMapper* isoMapper = vtkPolyDataMapper::New();

  isoMapper->SetInput(iso->GetOutput());

  isoMapper->SetScalarRange(0, 200);

  

  vtkActor* isoActor = vtkActor::New();

  isoActor->SetMapper(isoMapper);

 

Can someone help me to solve it?

Thanks!!!

 

Sincerely, 
                          Zhao Yongqiang
                          Dept. of Computer Science & Engineering
                          Shanghai JiaoTong University
                          Shanghai, China
                           <mailto:zhao-yq at cs.sjtu.edu.cn>
zhao-yq at cs.sjtu.edu.cn

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030331/6c818a47/attachment.htm>


More information about the vtkusers mailing list