[vtkusers] Oriented arrows in vtk.js

marf marvin.huber at basf.com
Wed Aug 22 10:14:06 EDT 2018


Hello there, I'm trying to get oriented arrows (meaning an arrow that spans
from point a to point b) in vtk.js.

I tried following this example but did not get to far
https://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/OrientedArrow

So what I do right now is trying to pass transformation matrices to my
actor, it kind of looks like this:

*const arrow = vtkArrowSource.newInstance();
const arrowMapper = vtk.Rendering.Core.vtkMapper.newInstance({
scalarVisibility: false });
arrowMapper.setInputData(arrow.getOutputData());
const arrowActor = vtk.Rendering.Core.vtkActor.newInstance();

arrowActor.setUserMatrix(matrix);
arrowActor.setMapper(arrowMapper);
this.renderer.addActor(arrowActor);*

When I define a rotation matrix and pass it, everything works fine. But when
I try to translate the arrows, all I get is some weird stretched arrow, with
a huge base passing into a tiny head or other stuff.
My transformation matrix would look like this
1, 0, 0, a,
0, 1, 0, b,
0, 0, 1, c,
0, 0, 0, 1

where a, b, c are the values I want to move the arrow by.

Can someone help me please? Maybe even in getting the C-Example translated?
(There's quite some stuff being used that is not part of vtk.js yet)



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html


More information about the vtkusers mailing list