<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=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 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:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Arial","sans-serif";
        mso-fareast-language:EN-US;}
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;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Arial","sans-serif";
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";
        mso-fareast-language:DE;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Arial","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></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=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Hi,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>i wrote a small POC to set some points in the render window. This works fine and I’ve found many examples which describe how to set the color for each point. But that’s the problem. I’ve got the following code:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#2B91AF;mso-fareast-language:DE'>vtkRenderWindow</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> renderWindow = </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:blue;mso-fareast-language:DE'>this</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'>.renderWindowControl1.RenderWindow;<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> <o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:green;mso-fareast-language:DE'>// create points-object</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'><o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#2B91AF;mso-fareast-language:DE'>vtkPoints</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> pts = </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#2B91AF;mso-fareast-language:DE'>vtkPoints</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'>.New();<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:green;mso-fareast-language:DE'>// create double-array for colors</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'><o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#2B91AF;mso-fareast-language:DE'>vtkDoubleArray</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> colors = </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#2B91AF;mso-fareast-language:DE'>vtkDoubleArray</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'>.New();<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> colors.SetName(</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:DE'>"colors"</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'>);<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> colors.SetNumberOfComponents(3);<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> <o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:green;mso-fareast-language:DE'>// insert point and color-tuple</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'><o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> pts.InsertNextPoint(0.0, 0.0, 0.0);<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> colors.InsertNextTuple3(0.3, 0.0, 0.0);<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> <o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#2B91AF;mso-fareast-language:DE'>vtkPolyData</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> polyData = </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#2B91AF;mso-fareast-language:DE'>vtkPolyData</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'>.New();<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:green;mso-fareast-language:DE'>// add points to polydata object</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'><o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> polyData.SetPoints(pts);<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:green;mso-fareast-language:DE'>// add colors to polydata object</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'><o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> polyData.GetPointData().AddArray(colors);<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> <o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> <o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:green;mso-fareast-language:DE'>// points should be displayed as crosses</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'><o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#2B91AF;mso-fareast-language:DE'>vtkGlyphSource2D</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> cross = </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#2B91AF;mso-fareast-language:DE'>vtkGlyphSource2D</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'>.New();<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> cross.SetGlyphTypeToCross();<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> <o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#2B91AF;mso-fareast-language:DE'>vtkGlyph3D</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> glyph = </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#2B91AF;mso-fareast-language:DE'>vtkGlyph3D</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'>.New();<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:green;mso-fareast-language:DE'>// connect polydata with glyph-object</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'><o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> glyph.SetInputConnection(0, polyData.GetProducerPort());<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> glyph.SetSourceConnection(0, cross.GetOutputPort());<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:green;mso-fareast-language:DE'>// define the input array for colors</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'><o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> glyph.SetInputArrayToProcess(3, 0, 0, 0, </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:DE'>"colors"</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'>);<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> glyph.SetColorModeToColorByScalar();<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> <o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#2B91AF;mso-fareast-language:DE'>vtkPolyDataMapper</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> mapper = </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#2B91AF;mso-fareast-language:DE'>vtkPolyDataMapper</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'>.New();<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> mapper.SetInput(glyph.GetOutput());<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#2B91AF;mso-fareast-language:DE'>vtkActor</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> actor = </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#2B91AF;mso-fareast-language:DE'>vtkActor</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'>.New();<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> actor.SetMapper(mapper);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>This code produces a yellow cross. But if I want to change the rgb values of the point it does not work, as I expected. If I change the line<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'><o:p> </o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> colors.InsertNextTuple3(0.3, 0.0, 0.0);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>to <o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:DE'> colors.InsertNextTuple3(0.3, 0.9, 0.9);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>then the cross is still yellow. I would have expected that the three values are interpreted as rgb values. The only interpreted value is the first double. If I change the first double value, the color of the cross changes. But I have to set rgb colors.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Do you understand my problem? Do I make a mistake? I am using VTK 5.6.1.599 with C#.NET.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Thank you very much.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Lukas<o:p></o:p></span></p></div></body></html>