
% cd ~
load ('shape_data.mat')

for ind = 1:numel(s)
  s{ind} = rmfield (s{ind}, 'Parent');
end

mode = 'solid';
drawColour = [1, 0, 0];

hax = axes ();

shapeObjects = {};
for ind = 1:numel (s)
  
    s{ind}.FaceLighting = 'Gouraud';
    s{ind}.AmbientStrength = 0.15;
    %s{ind}.Parent = self.transformObject;
    
    shapeObjects = [ shapeObjects, ...
                     { patch( hax, ...
                              s{ind} ) } ...
                   ];

end

for ind = 1:numel (shapeObjects)
    
    switch mode

        case 'solid'
            set (shapeObjects{ind}, 'FaceAlpha', 1.0);
            set (shapeObjects{ind}, 'FaceColor', drawColour);
            set (shapeObjects{ind}, 'EdgeColor', 'none');
        case 'wiresolid'
            set (shapeObjects{ind}, 'FaceAlpha', 1.0);
%            set (shapeObjects{ind}, 'FaceColor', drawColour);
%            set (shapeObjects{ind}, 'EdgeColor', drawColour);
        case 'ghost'
            set (shapeObjects{ind}, 'FaceAlpha', 0.25);
%            set (shapeObjects{ind}, 'FaceColor', drawColour);
            set (shapeObjects{ind}, 'EdgeColor', 'none');
        case 'wireframe'
%            set (shapeObjects{ind}, 'EdgeColor', drawColour);
            set (shapeObjects{ind}, 'FaceColor', 'none');
        case 'wireghost'
%            set (shapeObjects{ind}, 'EdgeColor', drawColour);
%            set (shapeObjects{ind}, 'FaceColor', drawColour);
            set (shapeObjects{ind}, 'FaceAlpha', 0.25);

        otherwise
            set (shapeObjects{ind}, 'FaceAlpha', 1.0);
%            set (shapeObjects{ind}, 'FaceColor', drawColour);
            set (shapeObjects{ind}, 'EdgeColor', 'none');

    end

end
          

light (hax);

view (hax, 3);
