From: James Ramm on
Hi,
Im looking at creating 3D objects using the surf command. My idea is to plot the upper and lower surface of an object with the surf command - easily done, as an example:
[X,Y,Z1]=peaks(100)
Z2 = Z1 - 10
C = Z1
surf(X,Y,Z1,C); hold on; surf(X,Y,Z2,C). I then currently calculate the boundary faces and use patch to plot each face, coloured according to the matching tile in the upper/lower surface, as in the file exchange function Surf3D
This has disadvantages in that each boundary face must be plotted individually, so that interpreted shading cannot be used on the surfaces (or the boundary faces colours wont match up well).

I figure that there must be some way to organize the data so that the surf function will see the nearest neighbours correctly and 'link' up the two surfaces as in the example above - does anyone know if this is possible?

Alternatively, is there a way that instead of surf using the i,j indices for connecting neighbours, as in;
i-1,j
|
i,j-1 - i,j - i,j+1
|
i+1,j
is there any surf-like function/method in which it would look at the i,j,k indices, such that the above matrices may be arranged as Z(:,:,1) = Z1; Z(:,:,2)=Z2; X(:,:,1) = X; X(:,:,2) = X
and so on...

Thanks for any help
From: James Ramm on
"James Ramm" <theres_ambrosia_there(a)hotmail.com> wrote in message <hvqa6s$mkg$1(a)fred.mathworks.com>...
> Hi,
> Im looking at creating 3D objects using the surf command. My idea is to plot the upper and lower surface of an object with the surf command - easily done, as an example:
> [X,Y,Z1]=peaks(100)
> Z2 = Z1 - 10
> C = Z1
> surf(X,Y,Z1,C); hold on; surf(X,Y,Z2,C). I then currently calculate the boundary faces and use patch to plot each face, coloured according to the matching tile in the upper/lower surface, as in the file exchange function Surf3D
> This has disadvantages in that each boundary face must be plotted individually, so that interpreted shading cannot be used on the surfaces (or the boundary faces colours wont match up well).
>
> I figure that there must be some way to organize the data so that the surf function will see the nearest neighbours correctly and 'link' up the two surfaces as in the example above - does anyone know if this is possible?
>
> Alternatively, is there a way that instead of surf using the i,j indices for connecting neighbours, as in;
> i-1,j
> |
> i,j-1 - i,j - i,j+1
> |
> i+1,j
> is there any surf-like function/method in which it would look at the i,j,k indices, such that the above matrices may be arranged as Z(:,:,1) = Z1; Z(:,:,2)=Z2; X(:,:,1) = X; X(:,:,2) = X
> and so on...
>
> Thanks for any help

anyone have any clues??