%
%  Example for cylinder projection
% 
%  R. Unger 06/2017
%

clear
close all

p=imread('map.png');


figure(1)
image(p)

[pic_height pic_width  c]=size(p)

R=20

k=0;
x=zeros(pic_width*pic_height,1);
y=zeros(pic_width*pic_height,1);
z=zeros(pic_width*pic_height,1);
s=zeros(pic_width*pic_height,1);
c=zeros(pic_width*pic_height,3);


for j=1:pic_height
 for i=1:pic_width
  
  phi=(i-1) * 1.0/(pic_width-1) * 2*pi ;
  h  =j;
  k=k+1;

  x(k)=R*cos(phi);
  y(k)=R*sin(phi);
  z(k)=h;

  s(k)=3;

  c(k,1) = double(p(pic_height-j+1,i,1) ) / 255.0;
  c(k,2) = double(p(pic_height-j+1,i,2) ) / 255.0;
  c(k,3) = double(p(pic_height-j+1,i,3) ) / 255.0;


 end
end

figure(2)
scatter3(x,y,z,s,c,'filled')




