[vtkusers] vtkVolumeTextureMapper2D problem
Frank Boettger
f.boettger at zeiss.de
Tue Jul 4 03:30:28 EDT 2000
I want to use vtkVolumeTextureMapper2D for volume rendering and encountered the
following problem:
Since the texture data is stored in a compound file, i'm reading my data into a
data pointer and use the appropriate vtkImageImport - functions to import it to VTK.
In order to prove success, i use a single bitmap as texture and display it using the
following code:
... (fill in data...)
vtkImageData *outData = vtkImageImporter->GetOutput();
if (outData)
{
vtkTexture = vtkTexture::New();
vtkTexture->SetInput(outData);
vtkPlaneSource = vtkPlaneSource::New();
vtkDataMapper = vtkPolyDataMapper::New();
vtkDataMapper->SetInput(vtkPlaneSource->GetOutput());
vtkActor = vtkActor::New();
vtkActor->SetMapper(vtkDataMapper);
vtkActor->SetTexture(vtkTexture);
vtkRenderer->AddActor(vtkActor);
vtkRenderer->ResetCamera();
vtkRenderer->ResetCameraClippingRange();
// interact with data
vtkRenderWindow->Render();
}
That's all fine and working as expected.
Now, when i read the same data the same way as before and pass it to
vtkVolumeTextureMapper2D, the output isn't what i expect - the image is somewhat
distorted as if the data isn't interpreted as with the above method. See attached
images. Here i use the following code:
... (fill in data...)
vtkImageData *outData = pImporter->GetOutput();
if (outData)
{
vtkVolMapper = vtkVolumeTextureMapper2D::New();
vtkVolMapper->SetInput(outData);
// Create the volume and set the mapper
vtkVolume *volume = vtkVolume::New();
volume->SetMapper(vtkVolMapper);
// Add this volume to the renderer
vtkRenderer->AddVolume(volume);
vtkRenderer->ResetCamera();
vtkRenderer->ResetCameraClippingRange();
// interact with data
vtkRenderWindow->Render();
}
Did i miss something? I'm sure that all dimension/extension etc. settings are right.
Anyone any idea??
Thanks in advance,
Frank
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Images.zip
Type: application/octet-stream
Size: 16361 bytes
Desc: Images.zip
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20000704/c412a3fa/attachment.obj>
More information about the vtkusers
mailing list