Code covered by the BSD License  

Highlights from
Pyramid built by UFO

image thumbnail

Pyramid built by UFO


Gustavo Orellana


Using matrix transformations and light to create ufo building pyramid.

dome(zpos, dimMult)
%Gustavo Adalid Orellana
%May 7, 2009
% dome.m Draw upper half circle
%Returns a handle to the surface object
%Parameters: zpos is a value that indicates
%the position in the z axis where the bottom
%of the upper circle is positioned. dimMult is a value that
%indicates by how much you want the semicircle shrunk or
%PostC.: Sets the Tag field of the dome surface to 'dome'
function f = dome(zpos, dimMult)
[x,y,z] = sphere(40);
x(1:21,:) = [];%Get rid of lower half
y(1:21,:) = [];%get rid of lower half
z(1:21,:) = [];%
x = x.*dimMult; %
y = y.*dimMult;
z = (z.*dimMult) + zpos; %translate zpos unit up
f = surf(x,y,z);
material shiny;
set(f,'FaceColor',[.6 .6 .85],'FaceAlpha',0.6,'EdgeAlpha',0,...
    'FaceLighting','phong','AmbientStrength',0.8, 'SpecularExponent',20,...
light('Position',[10 5 -1],'Style','infinite');

Contact us