[vtkusers] How to get texture coordinates from results of IntersectWithLine?

Ricky C. kf6kjg+vtk at gmail.com
Sun Jun 3 19:30:23 EDT 2018


 I'd posted this a few days back in StackOverflow (
https://stackoverflow.com/questions/50595530/how-to-get-
texture-coordinates-from-vtk-intersectwithline), but since I've not had an
answer yet there I decided to sub here and re-ask.

The question is best formatted there, but in summary I've loaded am OBJ
that has a 3D triangulated model with per-vertex texture coordinates: UV
coordinates.  I then IntersectWithLine against a vtkModifiedBSPTree of said
model, and get back the results.  If I got a result I want to then get the
texture coordinates at the intersection point.

I understand that the intersection point, if it exists at all, is unlikely
to land directly on a vertex.  Thus, since this model is triangulated,
there should always be 3 nearby vertices for any intersection point.  The
texture coordinates of each vertex can then be interpolated/weighted to
give me a new synthesized texture coordinate that is the texture coordinate
at the intersection point.

If anyone can help here, on SO, or both, that'd be great.

Thank you,
Ricky Curtice
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20180603/ff676060/attachment.html>


More information about the vtkusers mailing list