<DIV>My scalar data is the variable values at nodes of 3D irregular hexahedral cells from the </DIV>
<DIV>finite element modeling. I have been trying to volume-render this unstructured grid but have</DIV>
<DIV>had no luck so far. My questions would be</DIV>
<DIV> </DIV>
<DIV>1) How do I add hexahedral cells to the vtkUnstructuredGrid?</DIV>
<DIV>2) According to posts in this list, vtkUnstructuredGridVolumeRayCastMapper renders</DIV>
<DIV> tretrahedral cells only. Is vtkDataSetTriangleFilter the right filter to convert hexahedral</DIV>
<DIV> cells to tretrahedral cells?</DIV>
<DIV>3) I got an error message like this " E2316 'SetVolumeRayCastFunction' is not a member <BR> of 'vtkUnstructuredGridVolumeRayCastMapper". Did I miss including any header file?</DIV>
<DIV> According to an example IntermixedUnstructuredGrid.tcl, 'SetVolumeRayCastFunction'</DIV>
<DIV> is not required. Is this true?</DIV>
<DIV> </DIV>
<DIV>I am using VTK4.4 and running WinXP Pro. Here is part of my code. Thank you.</DIV>
<DIV>----------------------------------------------------</DIV>
<DIV> // Points and scalars<BR> vtkPoints *pts = vtkPoints::New();<BR> vtkDoubleArray *scalars = vtkDoubleArray::New();<BR> vtkUnstructuredGrid *ugrid = vtkUnstructuredGrid::New();<BR> ugrid->Allocate(NumPoints, NumPoints);</DIV>
<DIV> for (i=0; i<gNumCoreElems; ++i)<BR> {<BR> pts->InsertNextPoint(X[i], Y[i], Z[i]);<BR> scalars->InsertNextTuple1(V[i]);<BR> }<BR> ugrid->SetPoints(pts);<BR> ugrid->GetPointData()->SetScalars(scalars);</DIV>
<DIV>// Cells<BR>int nyz = ny * nz;<BR>int IndexOffset[8] = {0, 1, nz, nz+1, nyz, nyz+1, nyz+nz, nyz+nz+1}; <BR>vtkHexahedron *hexa = vtkHexahedron::New();<BR>n = 0;<BR>for (i=0; i<gNumCoreElem[0]-1; ++i)<BR>{<BR> for (j=0; j<gNumCoreElem[1]-1; ++j)<BR> {<BR> for (k=0; k<gNumCoreElem[2]-1; ++k)<BR> {<BR> for (kk=0; kk<8; ++kk) <BR> {<BR> hexa->GetPointIds()->SetId(VTK_HEXAHEDRON, n+IndexOffset[kk]);<BR> }<BR>
ugrid->InsertNextCell(hexa->GetCellType(), hexa->GetPointIds());<BR> ++n;<BR> }<BR> }<BR>}</DIV>
<DIV>// Volume rendering<BR>vtkUnstructuredGridVolumeRayCastMapper *volumeMapper =<BR> vtkUnstructuredGridVolumeRayCastMapper::New();<BR>vtkDataSetTriangleFilter *tri = vtkDataSetTriangleFilter::New();<BR>tri->SetInput(ugrid);<BR>volumeMapper->SetInput(tri->GetOutput());</DIV>
<DIV>vtkUnstructuredGridBunykRayCastFunction *compositeFunction =<BR> vtkUnstructuredGridBunykRayCastFunction::New();<BR> <BR>// E2316 'SetVolumeRayCastFunction' is not a member <BR>// of 'vtkUnstructuredGridVolumeRayCastMapper'<BR>volumeMapper->SetVolumeRayCastFunction(compositeFunction); // Error<BR>volume->SetMapper(volumeMapper);</DIV>
<DIV>vtkVolumeProperty *volumeProperty = vtkVolumeProperty::New();<BR> volumeProperty->SetColor(colorFunc);<BR> volumeProperty->SetScalarOpacity(opacityFunc);<BR> volumeProperty->ShadeOff();<BR> volumeProperty->SetInterpolationTypeToLinear();</DIV>
<DIV>volume->SetProperty(volumeProperty);<BR>.....</DIV>
<DIV> </DIV>
<DIV> </DIV><p>
                <hr size=1>Do you Yahoo!?<br>
Yahoo! Mail - Easier than ever with enhanced search. <a href="http://us.rd.yahoo.com/evt=29916/*http://info.mail.yahoo.com/mail_250">Learn more.</a>