<div dir="ltr"><div>Hi Pankaj,<br></div><div><br></div><div>You could use vtkTransformCoordinateSystems to transform the world coordinates of your vtkPolyData to display coordinates.</div><div>Also the convenience method vtkInteractorObserver::Compute<wbr>WorldToDisplay would be an option.</div><div><br></div><div>From these two display points you can derive the vector of the 2D line and then traverse the intermediate points.</div><div><br></div><div>However, this is method only gives you a description of the 2D line. It does not tell exactly which which pixels on the screen are rendered from that line. <br></div><div>The thickness of the line is neglected for example.<br></div><div><br></div><div>Regards,<br></div><div>Martijn<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-11-28 7:21 GMT+01:00 Pankaj Gupta <span dir="ltr"><<a href="mailto:stn.gupta.pankaj@gmail.com" target="_blank">stn.gupta.pankaj@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr"><span style="font-size:12.8px">Hi,</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"> I am new to vtk. I am using Activiz. I created multiple lines using vtkLine and display them using vtkActor. Now i want to draw line on 2D points calculated from the 3D Line Points. I want to know all the pixels of 3D lines from where my lines is passed. Below is my code.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div>vtkPoints points = vtkPoints.New();</div><div>for (int i = 0; i < point.Count; i++)</div><div>points.InsertNextPoint(x, y, z);</div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div>vtkCellArray lines = vtkCellArray.New();</div><div>for (int i = 0; i < point.Count-1; i++)</div><div>{</div><div> vtkLine line = vtkLine.New();</div><div> line.GetPointIds().SetId(0, i);</div><div> line.GetPointIds().SetId(1, i + 1);</div><div> lines.InsertNextCell(line);</div><div>}</div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div>vtkPolyData linesPolyData = vtkPolyData.New();</div><div>linesPolyData.SetPoints(points<wbr>);</div><div>linesPolyData.SetLines(lines);<br></div><div>linesPolyData.Update();</div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div>vtkPolyDataMapper mapper = vtkPolyDataMapper.New();</div><div>mapper.SetInput(linesPolyData)<wbr>;</div><div>mapper.Update();</div><div><br></div><div>vtkActor actor = vtkActor.New();</div><div>actor.SetMapper(mapper);</div><div>actor.GetProperty().SetLineWid<wbr>th(10);</div><div>actor.GetProperty().SetColor(2<wbr>55, 255, 0);</div><div>renderer.AddActor(actor);</div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Now i want to know the pixels on the lines. Please help me. Thanks in advance. :) :)</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Thanks,</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Pankaj</div></div>
</div><br></div>
<br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/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" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FA<wbr>Q</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div></div>