[vtkusers] vtkUnstructuredGridVolumeRayCastMapper

John Biddiscombe jbiddiscombe at skippingmouse.co.uk
Wed May 12 09:27:22 EDT 2004


>Input contains more than tetrahedra - only tetrahedra are supported

The ray caster only supports Tetrahedral cells for unstructured grid. You'll
need to triangulate them before raycasting.

JB



----- Original Message ----- 
From: "Paul McGuinness" <mcguinpg at maths.tcd.ie>
To: <vtkusers at vtk.org>
Sent: Wednesday, May 12, 2004 2:10 PM
Subject: [vtkusers] vtkUnstructuredGridVolumeRayCastMapper


>
> Hi vtk users,
>
> I hope that someone will be able to help me. This is my problem:
>
> I create a vtkUnstructuredGrid and create cells inside this grid by doing
> the following:
>
> ugrid->Allocate(num_of_vertices_per_facet, num_of_vertices_per_facet);
>   ugrid->Initialize();
>
> for (i=0; i<number_of_facets; i++)
> ugrid->InsertNextCell(VTK_TRIANGLE, num_of_vertices_per_facet,
> facet_vertices[i]);
>
> ugrid->SetPoints(points);   //coordinates of vertices
>   points->Delete();
>
> ugrid->GetPointData()->SetScalars(scalars); //scalar values at vertices
>   scalars->Delete();
>
> OK so that is pretty basic stuff.
> But here is the problem I want to create a volume rendering of this grid.
> So I just do the following:
>
> vtkPiecewiseFunction *opacityTransferFunction2 =
vtkPiecewiseFunction::New();
>    opacityTransferFunction2->AddPoint(0.0,   0.1);
>   opacityTransferFunction2->AddPoint(5.0,  0.3);
>   opacityTransferFunction2->AddPoint(10,  0.6);
>
>   vtkColorTransferFunction *colorTransferFunction2 =
vtkColorTransferFunction::New();
>   colorTransferFunction2->AddRGBPoint( 0.0, 0.0, 0.0, 0.0);
>   colorTransferFunction2->AddRGBPoint( 5, 1.0, 1.0, 1.0);
>   colorTransferFunction2->AddRGBPoint( 10, 1, 1, 1);
>
>
>   vtkVolumeProperty *volumeProperty2 = vtkVolumeProperty::New();
>   volumeProperty2->SetColor(colorTransferFunction2);
>   volumeProperty2->SetScalarOpacity(opacityTransferFunction2);
>   volumeProperty2->SetInterpolationTypeToLinear();
>
>     vtkUnstructuredGridVolumeRayCastMapper *volumeMapper2 =
vtkUnstructuredGridVolumeRayCastMapper::New();
>         volumeMapper2->SetInput(ugrid);
>
> etc......
>
> When I run my program I get no image, I also get the following warning
> message:
>
> Warning: In
/cphys/pgrad/mcguinpg/vtk/VTK/Rendering/vtkUnstructuredGridBunykRayCastFunct
ion.cxx, line 583
> vtkUnstructuredGridBunykRayCastFunction (0x84cdfb0): Input contains more
than tetrahedra - only tetrahedra are supported
>
>
> Does anyone know what is going on here, I am lost on this one?
>
> Thank you,
> Paul.
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list