

%mark=marker_generator(space,20)
mark=[1 1 2; 1 1 2; 4 4.5 3];
lato=400;
[uv, hidden, distance]=camera_simulation(camso.rotationmat,1000*camso(1).position,mark*1000,[ 1 0 lato/2 ;0 1 lato/2; 0 0 1 ],lato/2*inv(tan(pi/6)),lato,lato)
P=[uv' distance'];
piano=genera_piano_3D(P, lato ,lato,500,5000,50,10000)
imshow(piano);

figure(11)
view([75,30])
grid on
plotcam3(cams,space,voxels,latovoxel,[1 1 1 0 0 0 0])
view([75,30])
grid on
plotcam3(cams,space,voxels,latovoxel,[1 1 1 0 0 0 0])
axis equal

for i=1:size(mark,2)
% DrawCuboid([.2 .2 .2], mark(:,i),[0 0 0],'m',1)
plot3(mark(1,i),mark(2,i),mark(3,i),'mo')
hold on
end

for i=1:size(cams.setmarkers,2)
% DrawCuboid([.2 .2 .2], mark(:,i),[0 0 0],'m',1)
plot3(mark(1,cams(1).setmarkers(i)),mark(2,cams(1).setmarkers(i)),mark(3,cams(1).setmarkers(i)),'go')
hold on
end

figure(11)