[vtkusers] a question about vtkTextureMapToPlane,help!!

astermaymay at sjtu.edu.cn astermaymay at sjtu.edu.cn
Sat Apr 12 14:05:55 EDT 2003


I have a question,why the output doesn\'t change?
when I use the code below ,I can get anarbitrary slice 
    vtkPlane *plane=vtkPlane::New();
    plane->SetOrigin(100,0,0);
    plane->SetNormal(1,0,0);
    vtkCutter *planeCutter=vtkCutter::New();
    planeCutter->SetCutFunction(plane);
    planeCutter->SetInput(v16->GetOutput());      //v16 is a structureddata 
    vtkPolyDataMapper *planeMapper=vtkPolyDataMapper::New(); 
    planeMapper->SetInput(planeCutter->GetOutput());
    planeMapper->SetScalarRange(200,2000);
    planeMapper->SetLookupTable(bwLut);         
    vtkActor *planeActor=vtkActor::New();
    planeActor->SetMapper(planeMapper);
    aRenderer->AddActor(planeActor);
    aRenderer->SetBackground(1,1,1);
.....................
but when I want to texture this slice to  XY plane,the output  doesn\'t change :( ,it seems that the vtktexturemaptoplane doesn\'t operation
vtkPlane *plane=vtkPlane::New();
    plane->SetOrigin(100,0,0);
    plane->SetNormal(1,0,0);
    vtkCutter *planeCutter=vtkCutter::New();
    planeCutter->SetCutFunction(plane);
    planeCutter->SetInput(v16->GetOutput());      //v16 is a structureddata  
here I add:
  vtkTextureMapToPlane *planetextureMapper=vtkTextureMapToPlane::New();
  planetextureMapper->SetInput(planeCutter->GetOutput());
  planetextureMapper->AutomaticPlaneGenerationOn(); 
  planetextureMapper->SetOrigin(0,0,0);
  planetextureMapper->SetNormal(0,0,1);
  vtkCastToConcrete *geometryPD=vtkCastToConcrete::New();
   geometryPD->SetInput(planetextureMapper->GetOutput());
   vtkPolyDataMapper *planeMapper=vtkPolyDataMapper::New();
   planeMapper->SetInput(geometryPD->GetPolyDataOutput());

   planeMapper->SetScalarRange(200,2000);
   planeMapper->SetLookupTable(bwLut);      
   vtkActor *planeActor=vtkActor::New();
    planeActor->SetMapper(planeMapper);
    aRenderer->AddActor(planeActor);
    aRenderer->SetBackground(1,1,1);
who can tell me why?What effect does vtktexturemaptoplane has in the pipeline? 


More information about the vtkusers mailing list