[vtkusers] re: Try again - merging

Sean McInerney seanm at nmr.mgh.harvard.edu
Thu Aug 19 13:08:18 EDT 2004


Hi Jared,

   I have some C++ code based on the spherical Tcl example that I think 
solves your problem. It avoids a singularity at the Z axis by offsetting 
the plane by a very small amount. I am attaching the source file 
'spherical.cxx'. It takes any valid 2D vtkImageReader2 input and maps it 
to a sphere in the manner that you describe.

The Cmake configuration stuff is as follows:

ADD_EXECUTABLE (spherical spherical.cxx)
TARGET_LINK_LIBRARIES (spherical vtkRendering vtkIO vtkGraphics)

-Sean

Jared Cohen wrote:
>  Ooooookay, the image came out, but the text didn't. Lemme try this 
> again, sans image.
> 
> 
> I think I may have a similar problem. I built a sphere by creating a 
> PlaneSource and passing it through a TransformPolyDataFilter using a 
> SphericalTransform. I ended up with a perfect sphere *except* for one 
> missing strip of polys along the longitude=0 line. I closed this gap by 
> appending points to one end of the plane, before warping it. I also 
> tried to then pass the data into a CleanPolyData filter, to merge the 
> coincident points; but I ended up with a really weird effect, and I 
> couldn't fix it; I eventually had to give up on merging the points.
> 
> Take a look at the screenshot in my previous post; is this similar to 
> what you're experiencing?
> 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: spherical.cxx
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040819/ce91b4e5/attachment.asc>


More information about the vtkusers mailing list