%
% 3D human skeleton spine.
% The file 'spine' is a 2D data file available from the Matlab demo directory.
% A 3D representation is obtained by mapping the color to height Z and by
% creating an X,Y meshgrid.
%
clear
figure
load spine
colormap(gray);
size(X);
mobj = image(X);
xd = get( mobj, 'XData');
yd = get( mobj, 'YData');
Z  = get( mobj, 'CData');

figure
colormap(gray);
dx = 10;
dy = 10;
[X,Y] = meshgrid( [xd(1):dx:xd(2)], [yd(1):dy:yd(2)] );
mobj = mesh( X,Y,Z(1:dy:yd(2), 1:dx:xd(2)) );
writeoogl( mobj, 'spine.mesh', 1, 1, 1); 

