[vtkusers] volume rendering from the book, help me!!
"한종철"
madness78 at pusan.ac.kr
Tue Jun 26 02:50:41 EDT 2007
I' m doing a simple example for volume rendering using c++ based on SDI.
But it doesn't work!!
What's the problem??
Please help me!!
What's the problem???
This is my simple source code.
if(pvtkStructuredPointsReader)
{
this->opacityTransferFunction->AddPoint(2.0,0.0);
this->opacityTransferFunction->AddPoint(255,0.2);
this->colorTransferFunction->AddRGBPoint(0.0, 0.0, 0.0, 0.0);
this->colorTransferFunction->AddRGBPoint(64.0,1.0,0.0,0.0);
this->colorTransferFunction->AddRGBPoint(128.0,0.0,0.0,1.0);
this->colorTransferFunction->AddRGBPoint(192.0,0.0,1.0,0.0);
this->colorTransferFunction->AddRGBPoint(255.0,0.0,0.2,0.0);
this->volumeProperty->SetColor(colorTransferFunction);
this->volumeProperty->SetScalarOpacity(opacityTransferFunction);
this->volumeMapper -> SetVolumeRayCastFunction(compositeFunction);
this->volumeMapper -> SetInputConnection(this->pvtkStructuredPointsReader->GetOutputPort());
this->volume->SetMapper(volumeMapper);
this->volume->SetProperty(volumeProperty);
pcvtkSDIView->GetRenderer()->SetBackground(0,0,0);
pcvtkSDIView->GetRenderer()->AddVolume(this->volume);
pcvtkSDIView->GetRenderer()->ResetCamera();
pvtkStructuredPointsReader->Delete();
pvtkStructuredPointsReader = NULL;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070626/ec1be2b8/attachment.htm>
More information about the vtkusers
mailing list