<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>&nbsp;</DIV>
<DIV>1) How do I&nbsp;add hexahedral cells to the vtkUnstructuredGrid?</DIV>
<DIV>2) According to posts in this list, vtkUnstructuredGridVolumeRayCastMapper renders</DIV>
<DIV>&nbsp;&nbsp;&nbsp; tretrahedral cells only. Is vtkDataSetTriangleFilter the right filter to convert hexahedral</DIV>
<DIV>&nbsp;&nbsp;&nbsp; cells to tretrahedral cells?</DIV>
<DIV>3) I got an error message like this&nbsp;" E2316 'SetVolumeRayCastFunction' is not a member&nbsp;<BR>&nbsp; &nbsp;of 'vtkUnstructuredGridVolumeRayCastMapper". Did I miss including any header file?</DIV>
<DIV>&nbsp;&nbsp; According to an example IntermixedUnstructuredGrid.tcl, 'SetVolumeRayCastFunction'</DIV>
<DIV>&nbsp;&nbsp; is not required. Is this true?</DIV>
<DIV>&nbsp;</DIV>
<DIV>I am using VTK4.4 and running WinXP Pro. Here is part of my code. Thank you.</DIV>
<DIV>----------------------------------------------------</DIV>
<DIV>&nbsp;// Points and scalars<BR>&nbsp;vtkPoints *pts = vtkPoints::New();<BR>&nbsp;vtkDoubleArray *scalars = vtkDoubleArray::New();<BR>&nbsp;vtkUnstructuredGrid *ugrid = vtkUnstructuredGrid::New();<BR>&nbsp;ugrid-&gt;Allocate(NumPoints, NumPoints);</DIV>
<DIV>&nbsp;for (i=0; i&lt;gNumCoreElems; ++i)<BR>&nbsp;{<BR>&nbsp;&nbsp;&nbsp;pts-&gt;InsertNextPoint(X[i], Y[i], Z[i]);<BR>&nbsp;&nbsp;&nbsp; scalars-&gt;InsertNextTuple1(V[i]);<BR>&nbsp;}<BR>&nbsp;ugrid-&gt;SetPoints(pts);<BR>&nbsp;ugrid-&gt;GetPointData()-&gt;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};&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>vtkHexahedron *hexa = vtkHexahedron::New();<BR>n = 0;<BR>for (i=0; i&lt;gNumCoreElem[0]-1; ++i)<BR>{<BR>&nbsp;&nbsp; for (j=0; j&lt;gNumCoreElem[1]-1; ++j)<BR>&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (k=0; k&lt;gNumCoreElem[2]-1; ++k)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (kk=0; kk&lt;8; ++kk) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;hexa-&gt;GetPointIds()-&gt;SetId(VTK_HEXAHEDRON, n+IndexOffset[kk]);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 ugrid-&gt;InsertNextCell(hexa-&gt;GetCellType(), hexa-&gt;GetPointIds());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ++n;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp; }<BR>}</DIV>
<DIV>// Volume rendering<BR>vtkUnstructuredGridVolumeRayCastMapper *volumeMapper =<BR>&nbsp;&nbsp; vtkUnstructuredGridVolumeRayCastMapper::New();<BR>vtkDataSetTriangleFilter *tri = vtkDataSetTriangleFilter::New();<BR>tri-&gt;SetInput(ugrid);<BR>volumeMapper-&gt;SetInput(tri-&gt;GetOutput());</DIV>
<DIV>vtkUnstructuredGridBunykRayCastFunction *compositeFunction =<BR>&nbsp;&nbsp; vtkUnstructuredGridBunykRayCastFunction::New();<BR>&nbsp;&nbsp; <BR>// E2316 'SetVolumeRayCastFunction' is not a member <BR>// of 'vtkUnstructuredGridVolumeRayCastMapper'<BR>volumeMapper-&gt;SetVolumeRayCastFunction(compositeFunction);&nbsp; // Error<BR>volume-&gt;SetMapper(volumeMapper);</DIV>
<DIV>vtkVolumeProperty *volumeProperty = vtkVolumeProperty::New();<BR>&nbsp; volumeProperty-&gt;SetColor(colorFunc);<BR>&nbsp; volumeProperty-&gt;SetScalarOpacity(opacityFunc);<BR>&nbsp; volumeProperty-&gt;ShadeOff();<BR>&nbsp; volumeProperty-&gt;SetInterpolationTypeToLinear();</DIV>
<DIV>volume-&gt;SetProperty(volumeProperty);<BR>.....</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</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>