Raisin Bran Box
close all
clear
w = 0.190;
h = 0.274;
d = 0.06;
xdata = [0 w; 0 w];
ydata = [0 0; h h];
zdata = [d d; d d];
rgb = flipdim(imread('front.jpg'),1);
surface(xdata,ydata,zdata,rgb,...
'FaceColor','texturemap','EdgeColor','none');
rgb = flipdim(imread('back.jpg'),1);
zdata = [ 0 0; 0 0];
surface(fliplr(xdata),ydata,zdata,rgb,...
'FaceColor','texturemap','EdgeColor','none');
xdata = [w w; w w];
zdata = [0 d; 0 d];
rgb = flipdim(imread('right.jpg'),1);
surface(xdata,ydata,zdata,rgb,...
'FaceColor','texturemap','EdgeColor','none');
rgb = flipdim(imread('left.jpg'),1);
xdata = [0 0; 0 0];
surface(xdata,ydata,zdata,rgb,...
'FaceColor','texturemap','EdgeColor','none');
xdata = [0 0 ; w w];
ydata = [h h; h h];
zdata = [d 0; d 0];
rgb = imread('top.jpg');
surface(xdata,ydata,zdata,rgb,...
'FaceColor','texturemap','EdgeColor','none');
rgb = flipdim(imread('bottom.jpg'),1);
ydata = [0 0; 0 0];
surface(xdata,ydata,zdata,rgb,...
'FaceColor','texturemap','EdgeColor','none');
axis equal
grid on
view(-35,20);
set(gcf,'Color',[1 1 1]*254/255);
f = getframe(gcf);
rgb = frame2im(f);
imshow(rgb);
imwrite(rgb,'matlab_view.jpg');