[vtkusers] Volume Rendering help

Sentil Balaji profbalse at yahoo.co.in
Fri Jul 9 00:46:23 EDT 2004


Hey,

   I am trying to render a cylinder from its circular
section planes stored as .bmp files.When I render it I
get a hollow cylinder instead of a  solid one.I have
the code below ,does it ring a bell in anyones' smart
brain.If so, please help me out...Many Thanks....
**********************CODE******************************
#include<VTK4.4/vtkBMPReader.h>
#include<VTK4.4/vtkRenderWindow.h>
#include<VTK4.4/vtkRenderer.h>
#include<VTK4.4/vtkRenderWindowInteractor.h>
#include<VTK4.4/vtkPolyDataNormals.h>
#include<VTK4.4/vtkContourFilter.h>
#include<VTK4.4/vtkPolyDataMapper.H>
#include<VTK4.4/vtkActor.H>
#include<VTK4.4/vtkPolyData.h>
#include<VTK4.4/vtkImageData.h>
#include<VTK4.4/vtkOutlineFilter.h>
#include<VTK4.4/vtkVolumeRayCastMapper.h>
#include<VTK4.4/vtkVolumeRayCastCompositeFunction.h>
#include<VTK4.4/vtkVolume.h>
#include<VTK4.4/vtkDelaunay3D.h>
#include<VTK4.4/vtkDataSetMapper.h>

void main()
{
	vtkBMPReader *br=vtkBMPReader::New();
	vtkRenderWindow *win=vtkRenderWindow::New();
	vtkRenderer *ren=vtkRenderer::New();
	vtkRenderWindowInteractor
*it=vtkRenderWindowInteractor::New();
	vtkPolyDataNormals *pnorm=vtkPolyDataNormals::New();
	vtkPolyDataMapper *pmap=vtkPolyDataMapper::New();
	vtkContourFilter *cfilter=vtkContourFilter::New();
	vtkOutlineFilter *ofilter=vtkOutlineFilter::New();
	vtkVolumeRayCastMapper
*rmap=vtkVolumeRayCastMapper::New();
	vtkVolumeRayCastCompositeFunction
*rcomp=vtkVolumeRayCastCompositeFunction::New();
	vtkVolume *vol=vtkVolume::New();
	vtkActor *act=vtkActor::New();
	vtkDelaunay3D *del=vtkDelaunay3D::New();
	vtkDataSetMapper *dsm=vtkDataSetMapper::New();
	win->AddRenderer(ren);
	it->SetRenderWindow(win);
	br->SetDataExtent(1,256,1,256,1,50);
	br->SetFilePrefix("D:/DATA/d");
	br->SetFilePattern("%s%d.bmp");
	cfilter->SetInput(br->GetOutput());
	cfilter->SetValue(255,255);
	pnorm->SetInput(cfilter->GetOutput());
	pnorm->SetFeatureAngle(5.0);
	dsm->SetInput((vtkDataSet*)br->GetOutput());
	pmap->SetInput(cfilter->GetOutput());
	act->SetMapper(pmap);
	ren->AddActor(act);
	win->Render();
	it->Start();
}
*******************************************************

________________________________________________________________________
Yahoo! India Careers: Over 50,000 jobs online
Go to: http://yahoo.naukri.com/



More information about the vtkusers mailing list