<html>
<body>
<br>
Looking quickly at your code I don't see anything obviously wrong.
However, I would suggest trying a few things to isolate the
problem:<br><br>
1) Make sure your first component is the one you want mapped to color,
and the second is the one you want mapped to opacity.<br><br>
2) Try volProp-&gt;ShadeOff(). Perhaps you do not have good gradients in
your data and that is causing the problem (although you have a high
ambient so that shouldn't be the problem...)<br><br>
3) Leave your ImageSampleDistance at 1.0 (the default). Keep in mind that
a distance of 0.5 means that you cast 4 rays for every pixels on the
screen. I believe when OpenGL maps this texture to the screen, it will
sample it for the pixel value, meaning that you are throwing away 3/4 of
the information you created during ray casting.<br><br>
4) If all these fail, try using a solid color transfer function (all
values map to red for example) - do you get what you expect?<br><br>
<br>
Lisa<br><br>
<br><br>
At 02:15 PM 5/25/2005, Randall Hand wrote:<br>
<blockquote type=cite class=cite cite="">I have a long pipeline setup to
render a multifield dataset.&nbsp; one field I want mapped to opacity,
and the other one is a vector that I want magnitude mapped to color.<br>
My pipeline resembles the following:<br><br>
<br>
vtkDataSetReader -&gt; vtkArrayCalculator (to calculate magnitude) -&gt;
vtkGaussianSplatter -&gt; vtkImageShiftScale = Dataset with ColorField
single component scalar<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +-&gt;
vtkGaussianSplatter -&gt; ImageShiftScale = Dataset with OpacityField
single component scalar.<br><br>
I then do a
OpacityData-&gt;GetPointData()-&gt;AddArray(Colordata-&gt;GetPointData()-&gt;GetArray(&quot;colorField&quot;)),
and pass the result through a vtkMergeFields to combine the 2 fields into
a single dual-component field, and make the new field the Active
Scalar.<br><br>
<br>
I then construct my volume parts:<br>
&nbsp;&nbsp;&nbsp; vtkVolumeProperty *volProp =
vtkVolumeProperty::New();<br>
&nbsp;&nbsp;&nbsp; volProp-&gt;IndependentComponentsOff();<br>
&nbsp;&nbsp;&nbsp; volProp-&gt;SetColor(xf_Color);<br>
&nbsp;&nbsp;&nbsp; volProp-&gt;SetScalarOpacity(xf_Opacity);<br>
&nbsp;&nbsp;&nbsp; volProp-&gt;SetInterpolationTypeToLinear();<br>
&nbsp;&nbsp;&nbsp; volProp-&gt;ShadeOn();<br>
&nbsp;&nbsp;&nbsp; volProp-&gt;SetAmbient(0.7);<br><br>
&nbsp;&nbsp;&nbsp; // Now setup the Ray Caster<br>
&nbsp;&nbsp;&nbsp; vtkFixedPointVolumeRayCastMapper *modelMapper =
vtkFixedPointVolumeRayCastMapper::New();<br>
&nbsp;&nbsp;&nbsp; modelMapper-&gt;SetImageSampleDistance(0.5);<br>
&nbsp;&nbsp;&nbsp; modelMapper-&gt;SetSampleDistance(0.1);<br>
&nbsp;&nbsp;&nbsp;
modelMapper-&gt;SetInput(mergeFilter-&gt;GetOutput());<br><br>
&nbsp;&nbsp;&nbsp; // Creating Volume<br>
&nbsp;&nbsp;&nbsp; vtkVolume *volume = vtkVolume::New();<br>
&nbsp;&nbsp;&nbsp; volume-&gt;SetMapper(modelMapper);<br>
&nbsp;&nbsp;&nbsp; volume-&gt;SetProperty(volProp);<br>
&nbsp;&nbsp;&nbsp; volume-&gt;Update();<br><br>
When all is said and done, however, I just get a darkish blurry spot
(image Attached).&nbsp; Can anyone see what's wrong, or have I exposed a
bug in the FixedPointVolumeRayCastMapper ?&nbsp; I've been waiting to do
this since I figured out that the old VolumeRayCastMapper couldn't handle
multi-component data, and i'm anxious to see this work for once :)<br>
-- <br>
Randall Hand<br>
<a href="http://www.yeraze.com">http://www.yeraze.com</a> <br>
_______________________________________________<br>
This is the private VTK discussion list. <br>
Please keep messages on-topic. Check the FAQ at:
<a href="http://www.vtk.org/Wiki/VTK_FAQ" eudora="autourl">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" eudora="autourl">
http://www.vtk.org/mailman/listinfo/vtkusers</a></blockquote></body>
</html>