-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathplot_sampling_grid.m
More file actions
51 lines (36 loc) · 1.24 KB
/
Copy pathplot_sampling_grid.m
File metadata and controls
51 lines (36 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
function plot_sampling_grid(vargin)
% Either call the script as a function or change the following default value of
% 'grid_file' to run it as a self-suficient script.
if nargin ~= 1
% sampling grid
grid_file = 'auralization_matrices/auralization_matrix_ambisonics_pp_spherical_surface_L81.mat';
%grid_file = 'resources/grid_spherical_surface_L25.mat';
else
grid_file = vargin;
end
% -------------------------------------------------------------------------
load(grid_file);
figure;
set(gcf, 'Color', [1 1 1]);
set(gcf, 'Position', [700 100 500 500]);
if exist('sampling_points_outer', 'var')
plot3(sampling_points_outer(1, :), sampling_points_outer(2, :), sampling_points_outer(3, :), '.');
hold on;
plot3(sampling_points_inner(1, :), sampling_points_inner(2, :), sampling_points_inner(3, :), '.');
hold off;
% find farthest sampling point
r = vecnorm(sampling_points_outer, 2, 1);
else
plot3(sampling_points(1, :), sampling_points(2, :), sampling_points(3, :), '.', 'MarkerSize', 12);
% find farthest sampling point
r = vecnorm(sampling_points, 2, 1);
end
grid on;
box on;
axis equal;
axis([-1 1 -1 1 -1 1] * max(r)*1.2);
xlabel('x (m)');
ylabel('y (m)');
zlabel('z (m)');
camproj('perspective');
end