I am able to somewhat get what I need. I need to first create the plane using vtkPlaneSource and then apply the vtkTextureMapToPlane. However, this will only show up as a blank plane in the 3D view. I can manually apply the image, but I would prefer to have it load automatically. Is there something that I am missing?
Here is what I have: [code] vtkSmartPointer<vtkImageReader2Factory> imageFactory = vtkSmartPointer<vtkImageReader2Factory>::New(); vtkSmartPointer<vtkImageReader2> reader = imageFactory->CreateImageReader2(filename); reader->SetFileName(filename); reader->Update(); vtkSmartPointer<vtkPlaneSource> plane = vtkSmartPointer<vtkPlaneSource>::New(); plane->SetCenter( e, s, 0.0); plane->SetNormal(0.0, 0.0, 1.0); plane->SetOrigin( e, s, 0); plane->SetPoint1( e, n, 0); plane->SetPoint2( w, s, 0); plane->SetXResolution(1); plane->SetYResolution(1); plane->Update(); vtkSmartPointer<vtkTextureMapToPlane> texturePlane = vtkSmartPointer<vtkTextureMapToPlane>::New(); texturePlane->SetAutomaticPlaneGeneration(false); texturePlane->SetOrigin(w, s, 0); texturePlane->SetPoint1(e, s, 0); texturePlane->SetPoint2(w, n, 0); texturePlane->SetInput(plane->GetOutput()); texturePlane->Update(); mbds->SetBlock(1, texturePlane->GetOutput()); [/code] On Wed, Apr 6, 2011 at 11:39 AM, Brian Panneton <brian.panne...@gmail.com>wrote: > I have a reader which outputs a Multi-block Dataset containing a polygonal > mesh of vertices in one block. I am trying to add another block to contain a > 2D image on a plane. I am reading in the image as such: > > [code] > vtkSmartPointer<vtkImageReader2Factory> imageFactory = > vtkSmartPointer<vtkImageReader2Factory>::New(); > vtkSmartPointer<vtkImageReader2> reader = > imageFactory->CreateImageReader2(filename); > reader->SetFileName(filename); > reader->Update(); > > vtkSmartPointer<vtkTextureMapToPlane> texturePlane = > vtkSmartPointer<vtkTextureMapToPlane>::New(); > texturePlane->SetInput(reader->GetOutput()); > texturePlane->SetOrigin(0,0,0); > texturePlane->SetPoint1(1, 0, 0); > texturePlane->SetPoint2(0, 1, 0); > > mb->SetBlock(1, texturePlane->GetOutput()); > [\code] > > Under the Information Tab in the Object Inspector, I see the Image (Uniform > Rectilinear Grid) under the Multi-block DataSet. It has no cells or points. > The image does not show up in the 3d view either. > > How can I get the image to show up? > > Thanks, > Brian Panneton >
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview