From: Chris McGibbon on
"Jan Simon" <matlab.THIS_YEAR(a)nMINUSsimon.de> wrote in message <ho7ou4$gqa$1(a)fred.mathworks.com>...
> Dear Chris!
>
> > for i = 1:8
> > patch('Vertices',xyz','Faces',Q(:,:,i)',...
> > 'FaceColor',c(:,i),'EdgeColor',c(:,i),'FaceVertexCData',c(:,i),...
> > 'FaceLighting','gouraud','EdgeLighting','gouraud',...
> > 'AmbientStrength',0.6,'EraseMode','normal',...
> > 'BackFaceLighting','reverselit','LineStyle','none',...
> > 'VertexNormals',Vnorm);
> > end
>
> As far as I can see, your VNorm consists of NaN's only. Most likely you call facenorm with the wrong input. And are you sure that you want to apply the same Vnorm to all 8 PATCH objects?!
>
> Kind regards, Jan

Hi Jan
The property 'Vertices' contains all the data points for the sphere, so the 'VertexNormal' property must be the same size. I used the facenorm program in hopes that it would generate the correct vertex normals for the entire sphere when given the X,Y,Z coordinates of the sphere.

Each individual patch object (1/8th of the sphere surface) is specified by the indices in the 'Faces' property. I assume matlab gets the surface normals for each face from 'VertexNormal' property based on the indices in the 'Faces' property.

Perhaps facenorm only works with surface plot data?
First  |  Prev  | 
Pages: 1 2 3
Prev: GUI design
Next: Matlab and FTDI VCP drivers