[vtkusers] VTK-JS: How to visualize numbers
sebastien.jourdain at kitware.com
Fri Dec 1 10:20:17 EST 2017
You should fill the points in a static manner using the typed array like
var nbPoints = 10;
var coords = new Float32Array(nbPoints * 3);
coords = x0;
coords = y0;
coords = z0;
coords[3*n+0] = xn;
coords[3*n+1] = yn;
coords[3*n+2] = zn;
var polydata = vtkPolyData.newInstance();
Otherwise your approach with vtkPixelSpaceCallbackMapper seems correct.
On Fri, Dec 1, 2017 at 8:01 AM, Cristina Oyarzun <
coyarzunlaura at googlemail.com> wrote:
> Hello Sebastian,
> 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.
> My plan now is to create a vtkPointSet, and set this as inputData to the
> vtkPixelSpaceCallbackMapper. Is this correct?
> 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:
> var Points = vtkPoints.newInstance();
> Points.setPoint(0, 13, 10, 50);
> console.log("Points", Points.getNumberOfPoints());
> And I get always 0.
> Thank you!!
> On Wed, Nov 29, 2017 at 6:59 PM, Sebastien Jourdain <
> sebastien.jourdain at kitware.com> wrote:
>> The example you mention is the right approach for what you are looking
>> The reason why you don't need vtkFollowers+vtkTextActors, 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. ;-)
>> 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.
>> Let us know if you the example is not enough to get you started.
>> On Wed, Nov 29, 2017 at 10:51 AM, Cristina Oyarzun via vtkusers <
>> vtkusers at vtk.org> wrote:
>>> 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?
>>> Thank you!
>>> Powered by www.kitware.com
>>> Visit other Kitware open-source projects at
>>> Please keep messages on-topic and check the VTK FAQ at:
>>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>> Follow this link to subscribe/unsubscribe:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtkusers