[vtkusers] vtkTextureMapToSphere and PreventSeamOff not working as expected

Meehan, Bernard MEEHANBT at nv.doe.gov
Wed Aug 6 20:52:16 EDT 2014

I was trying to do the same thing last week. Try the
vtkTexturedSphereSource instead:

On 8/6/14 3:57 PM, "Alexander Pletzer" <pletzer at txcorp.com> wrote:

>I'm trying to wrap the simple attached image around a sphere using
>vtkTextureMapToSphere and got some unexpected result -- the word
>"center" appears twice. Also the blue line is completely absent. There
>also appears to be a small gap at longitude 0 (see testOne.png). It
>looks as if the texture file was used twice.
>Does anyone know hoe to fix this? After some googling I found that some
>people had to write a custom vtkTextureMapToSphere class to deal with
>this problem. I'd like the texture to completely cover the sphere, each
>of the "nw", "sw", "se", "ne", and "center" texts should only appear
>once, each of the red, blue, white, and green should also appear only
>Thanks in advance.
>import vtk
>import sys
>filename1 = "one.png"
># Create a render window
>ren = vtk.vtkRenderer()
>renWin = vtk.vtkRenderWindow()
>iren = vtk.vtkRenderWindowInteractor()
># Generate a sphere polydata
>sphere1 = vtk.vtkSphereSource()
># Read the image data from  file
>reader1 = vtk.vtkPNGReader()
># Create texture object
>texture1 = vtk.vtkTexture()
># Map texture coordinates
>map_to_sphere1 = vtk.vtkTextureMapToSphere()
># Create mapper and set the mapped texture as input
>mapper1 = vtk.vtkPolyDataMapper()
># Create actor and set the mapper and the texture
>actor1 = vtk.vtkActor()

More information about the vtkusers mailing list