-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update vtk.js pointFeature #953
Conversation
@manthey could you review this branch? |
@jourdain This doesn't work as written, and I suspect that we are doing things in a more obtuse way than we should. For ease of trying this out, I've made two interactive tutorial links to allow adjusting the code. This link is the existing vtk.js pointFeature. This link is this branch (adjusted to work in the tutorial context). |
I noticed some issue here:
But by fixing that, I get the following error:
|
This still needs to adjust opacity and color by point.
I've pushed a change that fixes setting the radius. It still doesn't alter the color or opacity by point. I've marked some TODO spots. Here is a tutorial editor link to this code, in case it is useful. |
Note that this is done via hacking the mapper's lookup table, so there is probably a better way to do it.
Is there still something for me to look at? |
@aashish24 This works. It has some mild eccentricities which I should document. For instance, when zoomed out, points become annular: |
@jourdain I hacked around how the lookup table returns color information. I still have a color array, but the values of it don't seem to be used, and then I return a lookup table data array which has the packed rgba color values (which is where I end up supporting opacity). I have two questions: Is there a simple way to not need the extra color array? Is there an example showing how to subclass something in vtkjs? It seems like it would be better for me to subclass LookupTable instead of abusing it the way I did. |
For class extension: https://kitware.github.io/vtk-js/docs/develop_class.html What do you colorBy if you don't have the color array? The LookupTable is meant to convert a field into an actual color. Since you seems to build the full RGBA for the full set of points, you should probably not use a lookup table and just use the raw data as an array in your pointset by setting "mapScalars=false". |
Make sure vtkjs features can be rerendered with a draw call. Mark the vtkjs point feature as not supporting stroke.
@jourdain Thanks -- I've refactored this to be simpler. I was misunderstanding the vtk.js documentation. |
Modify test to ensure the vtkjs point feature is updated at least once on an initial draw call.
@aashish24 This is ready for review. |
thanks. Do we still have the issue with "annular"? I believe that may be caused by clipping of spheres that are drawn by vtk.js. |
Yes. And, you are correct, it is the clipping. We can set the clip bounds to a larger range -- but I think that we should defer that to a future PR where we add a more general method to get the extents needed and set the bounds based on the actual extents (so we don't degrade z-buffer precision needlessly). |
sure sounds good. I guess this branch needs to be updated? Once that happens, I can approve it. |
You can approve it while it updates -- the checks ensure that the merge to master will be valid. |
No description provided.