function h3d_test07_movie(video_name, points) for i=1:size(points,2) norms(i) = norm(points(:,i)); end max_norm = max(norms); angular_cell_size_deg = 8; rho_cell_size = max_norm / 25; rho_min = -max_norm; rho_max = max_norm; base = h3d_create_struct(angular_cell_size_deg, rho_cell_size, rho_min, rho_max); axes = { [1 0 0], [0 1 0], [0 0 1], [0.5 0.5 0], [0.2 0.8 0.2], [0 0.05 1], [0 0.1 1]}; names = { 'x', 'y','z','a1','a2','a3','a4'}; % axes = { [1 1 0] }; % names = { 'x'}; for i=1:numel(axes) axis = axes{i}; hts = {}; delta = 15; angles = 0:delta:360-delta for a=1:numel(angles) angle = angles(a); fprintf('angle: %d\n', angle); R1 = rot_axis_angle(axis, deg2rad(angle) ); s1 = h3d_compute_cube_ht(base, R1*points); hts{a} = s1; end create_movie(hts, sprintf('h3d_test07_%s_%s.avi', video_name, names{i})); end function create_movie(hts, file) n = numel(hts); fh=figure; hold on; set(fh, 'Position', [100 100 800 400]) movegui(fh); % A = moviein(n); mov = avifile(file, 'fps', 7); %, 'compression', 'RLE'); for i=1:n movie_image(hts{i}); pause(0.4); mov = addframe(mov, getframe(fh)); % pause end mov = close(mov); function movie_image(hts) subplot(1,2,1); h3d_draw_sphere_hs(hts, 120) xlabel('x'); ylabel('y'); zlabel('z'); subplot(1,2,2); plot3points(hts.points,'.'); axis('equal'); axis([-1 1 -1 1 -1 1]); xlabel('x'); ylabel('y'); zlabel('z');