<br><br><div class="gmail_quote">On Sun, Jun 28, 2009 at 7:59 AM,  <span dir="ltr">&lt;<a href="mailto:enjoywm@cs.wm.edu">enjoywm@cs.wm.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
I want to render a color volume with 4 components: RGBA.<br>
I want to use component alpha instead of opacity mapping function to<br>
control the opacity. Can I do this?<br>
<br>
Thanks for help.<br>
<br>
Yixun<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br><div><br></div><div>This Was my qeuestion about a week age and I used this Soloution:</div><div>Filling an Image with 4 component r g b and alpha (value between 0 255)</div><div><br></div><div><div>
<br></div><div>vtkImageData*  pImage=vtkImageData::New();</div><div>pImage-&gt;SetDimensions(512,512,1);<br></div><div>pImage-&gt;SetScalarTypeToUnsignedChar();<br></div><div>pImage-&gt;SetNumberOfScalarComponents(4);<br>
</div><div>pImage-&gt;AllocateScalars();</div><div><br></div><div>and  </div><div>a For filling it a code like this</div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>ptr=(unsigned char*)pImage-&gt;GetScalarPointer();</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>while (i&lt;count)</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>{</div></div></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<span class="Apple-tab-span" style="white-space:pre">        </span>*ptr=0;ptr++;//red<br>         *ptr=120; ptr++; //green<br>         *ptr=0;ptr++;//blue<br>          *ptr=i%255;ptr++;//alpha<br><br></blockquote><div><div><div>
<span class="Apple-tab-span" style="white-space:pre">                </span>  </div><div><span class="Apple-tab-span" style="white-space:pre">                </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div>
<br></div></div><div><br></div><div>and I Used it as Texture for a plane</div><div>vtkTexture* pTex=vtkTexture::New();<br></div><div><div>pTex-&gt;SetInput(pImage);<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><br></div></div></div>