Hi,<br><br>I'm trying to use vtkPlaneSource, and pasting a vtkTexture which gets its data from vtkImageData. The code below displays the image fine, but it does not match the image size in pixels. How do I configure vtkPlaneSource so that I see the image of proper size??<br>
<br>------------------------------------------------------------------------------------------------------------------------------------------------<br><br> vtkPNGReader *pngReader = vtkPNGReader::New();<br> pngReader->SetFileName(argv[1]);<br>
pngReader->Update();<br> ima = pngReader->GetOutput();<br><br>vtkTexture* VTKtexture = vtkTexture::New();<br> VTKtexture->SetInput(ima);<br> VTKtexture->InterpolateOn(); <br><br>vtkPlaneSource* VTKplane = vtkPlaneSource::New();<br>
VTKplane->SetOrigin( -0.5, -0.5, 0.0);<br> VTKplane->SetPoint1( 0.5, -0.5, 0.0);<br> VTKplane->SetPoint2( -0.5, 0.5, 0.0);<br><br> vtkPolyDataMapper *VTKplaneMapper = vtkPolyDataMapper::New();<br> VTKplaneMapper->SetInputConnection(VTKplane->GetOutputPort());<br>
<br><br> vtkActor* VTKplaneActor = vtkActor::New();<br> VTKplaneActor->SetTexture(VTKtexture);<br> VTKplaneActor->SetMapper(VTKplaneMapper);<br> <br> vtkRenderer *ren = vtkRenderer::New();<br> vtkRenderWindow *renwin = vtkRenderWindow::New();<br>
renwin->AddRenderer(ren);<br> renwin->FullScreenOn();<br><br> vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();<br> iren->SetRenderWindow(renwin);<br> ren->AddActor(VTKplaneActor);<br>
ren->SetBackground(0,0,0.5);<br> renwin->Render();<br><br>--------------------------------------------------------------------------------------------------------------------------------------<br><br>