Path: news.mathworks.com!newsfeed-00.mathworks.com!nlpi057.nbdc.sbc.com!prodigy.net!news.glorb.com!postnews.google.com!p5g2000pre.googlegroups.com!not-for-mail
From: "pouncingmoose@gmail.com" <pouncingmoose@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: surface/lighting problem
Date: Thu, 11 Jun 2009 16:29:31 -0700 (PDT)
Organization: http://groups.google.com
Lines: 34
Message-ID: <7565cf0d-4f8b-44f8-8121-9daa9bb6e7f5@p5g2000pre.googlegroups.com>
NNTP-Posting-Host: 66.183.137.75
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1244762972 10395 127.0.0.1 (11 Jun 2009 23:29:32 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 11 Jun 2009 23:29:32 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: p5g2000pre.googlegroups.com; posting-host=66.183.137.75; 
	posting-account=mVUfAQoAAADneFjsCdIL4SDX_5D4zuK9
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; 
	Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; 
	.NET CLR 3.5.30729),gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:546736


I'm hoping that someone more knowledgeable than myself on MATLAB's 3D
graphics might be able to help overcome the following problem:

I have some data for a spheroid that I need to apply a texture to,
however when I visualize it the sphere it has an ugly "seam" down the
side that I can't find a way to remove.
The following code generates a sphere that when rotated (manually)
looks fine:

close all
[X,Y,Z] = sphere(10);
he = surface(X,Y,Z,'LineStyle','none');
shading interp
rotate3d on
view(3);
axis equal
grid on
box on
xlabel('x');ylabel('y');zlabel('z');
set(gca,'Color',get(gcf,'Color'));

However if I then add some lighting with the following 2 lines:

light('Position',[-0.05 -0.7 1.6],'Style','infinite');
lighting phong

then the image has an ugly seam down the y-axis where the data wraps.
How can I get rid of this seam?

I've tried generating the sphere using (a single call to) patch, and
that works (i.e. the seam doesn't show), but unfortunately patch
doesn't allow for a texture map to be applied.

Any suggestions would be appreciated.