[vtkusers] Volume rendering, version probelms.
Jung-Su Oh
koorye at bmsil.snu.ac.kr
Sat Dec 21 00:03:17 EST 2002
Hello.
I'm beginner of VTK and have a little knowledge about volume rendering.
I've some questions and I will pick them in those following with red characters.
(I'm going to explane based on the old version- maybe Ver 3.1, the book 'VTK 2nd Ed."
and I'm working on Windows platform.)
vtkRenderer *ren1 = vtkRenderer::New();
vtkRenderWindow *renWin = vtkRenderWindow::New();
renWin->AddRenderer(ren1);
vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
iren->SetRenderWindow(renWin);
vtkStructuredPointsReader *reader = vtkStructuredPointsReader::New();
reader->SetFileName("../vtkdata/ironProt.vtk");
reader->Update();
vtkPiecewiseFunction *oTFun = vtkPiecewiseFunction::New();
oTFun->AddSegment(80,0.0,255,1.0);
vtkPiecewiseFunction *gTFun = vtkPiecewiseFunction::New();
gTFun->AddSegment(0,1.0,255,1.0);
vtkVolumeProperty *volProperty = vtkVolumeProperty::New();
volProperty->SetColor(gTFun);
volProperty->SetGradientOpacity(oTFun);
(is old version function SetOpacity changed into SetGradientOpacity?)
volProperty->SetInterpolationTypeToLinear();
volProperty->ShadeOn();
vtkVolumeRayCastCompositeFunction *compositeFunction =
vtkVolumeRayCastCompositeFunction::New();
vtkVolumeRayCastMapper *volMapper =
vtkVolumeRayCastMapper::New();
volMapper->SetScalarInput(reader->GetOutput());
(In ver 4.0 there is no SetScalarInput function....
Which function can we displace with this function ??
Please mail me SOON....)
If possible, please give some complete volume rendering source code
using VTK.
vtkVolume *vol = vtkVolume::New();
//SetVolumeMapper -> SetMapper
//SetVolumeProperty -> SetProperty
vol->SetMapper(volMapper);
vol->SetProperty(volProperty);
ren1->AddVolume(vol);
ren1->GetActiveCamera()->Azimuth(20);
ren1->GetActiveCamera()->Dolly(1.65);
//iren->SetDesiredUpdateRate(3.0); This function does not exists also.
iren->Start();
return 0;
Regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20021221/bdc30b05/attachment.htm>
More information about the vtkusers
mailing list