Hey all,
I am trying to use a single polydata with differents point data scalars mapped to it in vtk.js but I did not manage how to do it. I tried:
polyData.getPointData().setActiveScalars(polyData.getPointData().getArrayByIndex(0).getName());
mapper0.setInputData(polyData);
polyData.getPointData().setActiveScalars(polyData.getPointData().getArrayByIndex(1).getName());
mapper1.setInputData(polyData);
but both actors associated to the mappers display the same point data scalars (index 1), which I expected. Attempt #2:
mapper0.setInputData(polyData);
mapper1.setInputData(polyData);
mapper0.setColorByArrayName(polyData.getPointData().getArrayByIndex(0).getName());
mapper1.setColorByArrayName(polyData.getPointData().getArrayByIndex(1).getName());
But this does not seem to have any effect.
Is there a method to choose which scalars the mapper will map, besides setActiveScalars, or do I need to create as many copies as my polydata as I have mappers? If so, what is the recommended way to create such copies?
Thanks!