<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Hi Shady;<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>VTK uses normalized color values so you must do these divisions:<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:11.0pt;
font-family:Consolas'> r=double(re)/255.0;<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:11.0pt;
font-family:Consolas'> g=double(ge)/255.0;<o:p></o:p></span></p>
<p class=MsoNormal style='text-indent:.5in'><span style='font-size:11.0pt;
font-family:Consolas'>b=double(be)/255.0;<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:Consolas;
color:#4F81BD'>re,ge and be are your integer RGB values(for your program
re=147,ge=112, be=219), r,g,b are normalized color values which are used by
vtk...</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#4F81BD'><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
vtkusers-bounces@vtk.org [mailto:vtkusers-bounces@vtk.org] <b>On Behalf Of </b>Shady
Shidfar<br>
<b>Sent:</b> Wednesday, July 30, 2008 5:19 PM<br>
<b>To:</b> vtkusers@vtk.org<br>
<b>Subject:</b> [vtkusers] vtkProperty , color setting problem<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<div>
<div>
<p class=MsoNormal>Hi Everyone,<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> <o:p></o:p></p>
</div>
<div>
<p class=MsoNormal>I'm having a wierd problem with vtkProperty. I create a line
and specify a color for it. The problem is that some (actually
most) RGB values I pass to vtkProperty won't generate the
related colour. say for example slateblue identified by R=147, G=112 and
B=219 (<a
href="http://www.ecrion.com/Support/Resources/XSL-FOTutorial/ApendixA.xml.html">http://www.ecrion.com/Support/Resources/XSL-FOTutorial/ApendixA.xml.html</a>)
appears as white?????!!!!!!! and it's not only that color. Can someone
tell me what's the solution the create any RGB color. Here's my code:<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> <o:p></o:p></p>
</div>
<div>
<p><span style='font-size:10.0pt'>vtk.<span style='color:#2B91AF'>vtkLineSource</span>
line = <span style='color:blue'>new</span> <span style='color:#2B91AF'>vtkLineSource</span>();<o:p></o:p></span></p>
<p><span style='font-size:10.0pt;color:green'>line.SetPoint1(0.0, 0.0, 0.0);<o:p></o:p></span></p>
<p><span style='font-size:10.0pt;color:green'>line.SetPoint2(50, 50, 0.0);<o:p></o:p></span></p>
<p> <o:p></o:p></p>
<p><span style='font-size:10.0pt;color:#2B91AF'>vtkPolyDataMapper</span><span
style='font-size:10.0pt'> mapper = <span style='color:blue'>new</span> <span
style='color:#2B91AF'>vtkPolyDataMapper</span>();<o:p></o:p></span></p>
<p><span style='font-size:10.0pt'>mapper.SetInput(line.GetOutput());<o:p></o:p></span></p>
<p> <o:p></o:p></p>
<p><span style='font-size:10.0pt;color:#2B91AF'>vtkActor</span><span
style='font-size:10.0pt'> lineActor = <span style='color:blue'>new</span> <span
style='color:#2B91AF'>vtkActor</span>();<o:p></o:p></span></p>
<p><span style='font-size:10.0pt'>lineActor.SetMapper(mapper);<o:p></o:p></span></p>
<p> <o:p></o:p></p>
<p><span style='font-size:10.0pt;color:green'>//set line properties<o:p></o:p></span></p>
<p><span style='font-size:10.0pt;color:#2B91AF'>vtkProperty</span><span
style='font-size:10.0pt'> property = <span style='color:blue'>new</span> <span
style='color:#2B91AF'>vtkProperty</span>();<o:p></o:p></span></p>
<p><span style='font-size:10.0pt'>property.SetColor(147.0, 112.0, 219.0);<o:p></o:p></span></p>
<p><span style='font-size:10.0pt'>lineActor.SetProperty(property);<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<div class=MsoNormal align=center style='text-align:center'>
<hr size=1 width="100%" align=center>
</div>
<p class=MsoNormal>Not happy with your email address? <br>
<a href="http://uk.docs.yahoo.com/ymail/new.html">Get the one you really want</a>
- millions of new email addresses available now at <a
href="http://uk.docs.yahoo.com/ymail/new.html">Yahoo!</a><o:p></o:p></p>
</div>
</body>
</html>