[vtkusers] re: Try again - merging

Sean McInerney seanm at nmr.mgh.harvard.edu
Thu Aug 19 14:34:55 EDT 2004


Jared,

   You'll notice that the band of crap on your sphere is actually your 
entire texture mirror mapped onto that single strip of polygons ... not 
just from the center as I said previously ... unless that strip is 1 
pixel wide ;-)

-Sean

Sean McInerney wrote:
> Hi Jared,
> 
>   Actually, I think that I do understand your problem. If you merge the 
> non-polar points along the edges of the plane mapped to the sphere, what 
>  are the texture coordinates of those points? Get it? Before the merge, 
> they're zero (0) on one side, one (1) on the other. After the merge, you 
> are getting an interpolation between 0 and 1 / thetaRes - 1 (i.e. some 
> crap from the center of your image being placed along that border). 
> Furthermore, by using the offsetting that I suggest, as well as going 
> back and forth with the transform, you'll avoid having a black hole at 
> the north pole (you'll see what I mean). The bottom line is that, for 
> you, the only points worth merging are probably the poles. Even then, 
> you'll end up with texture artifact that won't show up with merging.
> 
>   So, this doesn't solve the *grand* merging debate, but it may solve 
> yours ;-)
> 
> -Sean
> 
> Jared Cohen wrote:
> 
>> Thanks, but I don't think you understand the problem. I can close the 
>> gap just fine, but the two edges will overlap without being merged 
>> together. It's when I merge them using a CleanPolyData filter that I 
>> get the warping effect.
>>
>>
>>
>>> 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
>>>
> _______________________________________________
> This is the private VTK discussion list. Please keep messages on-topic. 
> Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 



More information about the vtkusers mailing list