[vtkusers] Picker to get texture coordinates

Donny Zimmerman zmanvortex at gmail.com
Sat Sep 17 12:41:07 EDT 2016


I have figured it out. Since my world coordinates are in meters from the
center of the earth, I used vtkWorldPointPicker to get the world
coordinates and then convert it to Latitude and Longitude using
vtkGlobeSource::ComputeLatitudeLongitude. I then use an algorithm to
calculate the distance in meters and bearing in degrees from a known point
to interpolate to my image data coordinates.

On Thu, Sep 15, 2016 at 8:17 PM, Donny Zimmerman <zmanvortex at gmail.com>
wrote:

> I am using vtk to texture polygons (triangles). I use a single texture and
> calculate what area of the texture is mapped to each polygon and then
> assign the correct u,v texture coordinates to the polygon points.
>
> Using a spot that is picked on the textured polygon, I need to find the
> coordinates of the 2D vtkImageData (x,y) that was used to create the
> texture. I am having trouble wrapping my head around a way to do this.
>
> I am looking at using vtkWorldPointPicker, reverse my transformation to
> get the pre-transformed world coordinate, and then use my u,v texture
> coordinate calculation to find the x,y coordinate of the vtkImageData.
>
> I can't use the nearest polydata point that was picked because there are
> only 3 per polydata which would be at the edge of the texture.
>
> Is there an easier solution?
>
> Thanks.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160917/a8c73966/attachment.html>


More information about the vtkusers mailing list