Assigning a 2D image for every face of a 3D cube: MATLAB
问题 I want to build a cube in MATLAB and assign different 2D images for its faces. I think this is called texture mapping. I've searched for such a code, but what I found is a code that is able to assign a single image to all of the cube faces, the code is available here (http://www.mathworks.com/matlabcentral/answers/32070-rgb-images-on-a-3d-cube). Here is the code, cdata = flipdim( imread('peppers.png'), 1 ); cdatar = flipdim( cdata, 2 ); % bottom surface([-1 1; -1 1], [-1 -1; 1 1], [-1 -1; -1