function [I] = Splat(image, dot_coords) %You send this function the coords you'd like %to splat onto the image you provide, %and it returns the image frame. I thought %about you deciding the size of the image, %but we want to avoid any scaling here. %Scaling should be done by the Pifw function. %I use Bill Baxter's code to draw the dots %on the screen. I also normalize the dot %coords. isize = size(image); I = zeros(isize(1),isize(2)); temp = size(dot_coords); %size(I) for i=1:temp(2) x = dot_coords(1:3,i); x = x/(x(3)); I = I + gauss2d([0:isize(2)-1],[0:isize(1)-1],[x(1),x(2)],[1.5 0;0 1.5]); end %Due to projection intersections, occasionally %most points would flash dark in the movie, %because of the additive property above. %So here, I'll try to mitigate that problem. sample_gauss = gauss2d([0:256],[0:256],[128,128],[1.4 0;0 1.4]); scale = max(max(sample_gauss)); %size(scale) scale = 255/scale; I = I*scale;