<div dir="ltr">Hi Cristina,<div><br></div><div>You should fill the points in a static manner using the typed array like below:</div><div><br></div><div>var nbPoints = 10;</div><div>var coords = new Float32Array(nbPoints * 3);<div><br class="gmail-Apple-interchange-newline">coords[0] = x0;</div>coords[1] = y0;<br class="gmail-Apple-interchange-newline">coords[2] = z0;</div><div>[...]<br class="gmail-Apple-interchange-newline">coords[3*n+0] = xn;</div>coords[3*n+1] = yn;<br class="gmail-Apple-interchange-newline">coords[3*n+2] = zn;<div></div><div><br></div><div>var polydata = vtkPolyData.newInstance();</div><div>polydata.getPoints().setData(coords, 3);</div><div><br></div><div>Otherwise your approach with <span style="font-size:12.8px">vtkPixelSpaceCallbackMapper seems correct.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Seb</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 1, 2017 at 8:01 AM, Cristina Oyarzun <span dir="ltr"><<a href="mailto:coyarzunlaura@googlemail.com" target="_blank">coyarzunlaura@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hello Sebastian,<br></div><div><br></div><div>I am trying to adapt the example to my current problem. I have a render window with 4 renderers. Each renderer has several actors and some of them should get labels next to them. <br></div><div><br></div><div>My plan now is to create a vtkPointSet, and set this as inputData to the vtkPixelSpaceCallbackMapper. Is this correct? <br></div><div><br></div><div>My problem right now is that when I try to set a point in a vtkPoints the vtkPoints remains empty. Do you have any idea what the problem could be? Just to test I simplified the problem to this:</div><div><br></div><div>var Points = vtkPoints.newInstance();</div><div>Points.setPoint(0, 13, 10, 50);</div><div>console.log("Points", Points.getNumberOfPoints());</div><div><br></div><div>And I get always 0.</div><div><br></div><div>Thank you!!</div><span class="HOEnZb"><font color="#888888"><div>Cristina<br></div><div><br></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 29, 2017 at 6:59 PM, Sebastien Jourdain <span dir="ltr"><<a href="mailto:sebastien.jourdain@kitware.com" target="_blank">sebastien.jourdain@kitware.<wbr>com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The example you mention is the right approach for what you are looking for.<div><br></div><div>The reason why you don't need <span style="font-size:12.8px">vtkFollowers+</span><span style="font-size:12.8px">vtkTextActor<wbr>s</span><span style="font-size:12.8px">, is that we have a 2D layer on top of the 3D for which it is trivial to render text that is always facing the camera. ;-)</span></div><div><span style="font-size:12.8px">And we have a mechanism that can convert a set of location in the 3D world into the screen space so those label could be printed. </span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Let us know if you the example is not enough to get you started.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Seb</span></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_6139266295649799322h5">On Wed, Nov 29, 2017 at 10:51 AM, Cristina Oyarzun via vtkusers <span dir="ltr"><<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_6139266295649799322h5"><div dir="ltr"><div><div>Hello,<br><br></div>I would like to visualize some numbers next to my actors. I saw an example (Spheres and Labels) where a canvas is created for this purpose. I remember doing this using vtkFollowers in the past. Is there currently some easy way to do this with vtk-js? I mean something similar to vtkFollowers or vtkTextActors?<br></div><div><br></div><div>Thank you!</div><span class="m_6139266295649799322m_2300117539758602745HOEnZb"><font color="#888888"><div>Cristina<br></div><br></font></span></div>
<br></div></div>______________________________<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>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>