title: Tiling images with 3D perspective
body: <p>I'm not quite sure if the captioned is my problem. I will explain the challenge first and then probably you can advise whether I'm doing something fundamentally wrong.</p>
  
  <p>I'm creating an iOS application which will let users drag and drop floor and wall tiles on a room (pre-selected room images only) and can see how that tile will look when laid on the room. I have the tile images and the room image and I've defined hotspots (where tile need to be replaced) relative to the room image.</p>
  
  <p>On my room simulator view, I have a UIImageView which holds the room image and certain parts of that image are made transparent. I also have smaller UIImageViews which I have put on top of the room image.</p>
  
  <p>When the user drags and drops the tile image on the smaller image views, I'm creating an UIImage using the method</p>
  
  <pre><code>[sourceImage resizableImageWithCapInsets:UIEdgeInsetsZero resizingMode:UIImageResizingModeTile];
  </code></pre>
  
  <p>which gives me a tiled image and that image is then set as the source of the smaller image view.</p>
  
  <p>This logic is working but I'm not getting the desired effect. If the user is dropping the tile on the floor, the final image looks like the floor and the walls are on different planes. Please checkout the image below </p>
  
  <p><img src="https://i.stack.imgur.com/9M6cu.jpg" alt="here"></p>
  
  <p>The view on the right has 2 images, the room images with transparency and a smaller image where you see the floor tile now.</p>
  
  <p>So my question is, can I tile images with some sort of 3D perspective ? I'm afraid I'm not that good in 3D transformations and the 3d matrices looks greek to me.</p>
  
  <p>I guess the problem is mostly because of the angle in which we are viewing the resultant image and the floor tile images should be tiled with that in mind. Or in other words, the size of the tile on the back side of the room should be smaller than the size of the tile in the front side. I may be wrong.</p>
  
  <p>Any help would be greatly appreciated.</p>