function [mov] = make_ray_movie(spheres, lights, eyes, dovs, asize, bsize) %This function makes a movie of the ray traced %spheres, as it's view from the multiple centers %of projection provided by eyes. The user %also specifies resolution. I = zeros(bsize,asize,3); [m,n] = size(I); figure('Units','pixels','Position',[100 100 n m]) image(I); set(gca,'Position',[0 0 1 1]) set(gca,'nextplot','replacechildren'); aviobj = avifile('ray7.avi'); aviobj.Quality = 100; isize = size(eyes); for j= 1:isize(2); ceye = eyes(1:3,j); cdov = dovs(1:3,j); %ceye(3) = -ceye(3); %I had to do this, until I started saving to %an avi file. I think it has to do with how %the avi object views the frame verses how %the figure plotter views it. I = raytrace(spheres,lights,ceye',cdov', bsize, asize); %max(max(I)) imagesc(I); mov(j) = getframe; aviobj = addframe(aviobj,mov(j)); end aviobj = close(aviobj); movie(mov)