title: How to display a part of a scene in another scene (Scene Kit + Swift)
body: <p><strong>First, I just want to introduce to you guys my problem, because it is really complex so you need this to understand it properly.</strong><br>
  I am trying to do something with Scene Kit and Swift : I want to reproduce what we can see in the TV Show <em>Doctor Who</em> where the Doctor's spaceship is bigger on the inside, as you can see <a href="http://youtu.be/OrFpjh4KF4U?t=10s" rel="nofollow noreferrer">in this video</a>.<br>
  Of course the Scene Kit Framework doesn't support those kind of unreal dimensions so we need to do some sort of hackery to do achieve that.  </p>
  
  <p><strong>Now let's talk about my idea in plain english</strong><br>
  In fact, what we want to do is to display two completely different dimensions at the same place ; so I was thinking to :</p>
  
  <ul>
  <li>A first dimension for the inside of the spaceship.</li>
  <li>A second dimension for the outside of the spaceship.</li>
  </ul>
  
  <p>Now, let's say that you are outside of the ship, you would be in the <em>outside dimension</em>, and in this outside dimension, my goal would be to display a portion of the inside dimension at the level of the door to give this effect where the camera is outside but where we can clearly see that the inside is bigger :
  <img src="https://i.stack.imgur.com/nMQGT.png" alt="We can see a spaceship (that looks like a police box), this ship is pretty small but we can see the inside of this ship through these open doors, and the inside looks much bigger than the inside"><br>
  <em>We would use an equivalent principle from the inside.</em></p>
  
  <p><strong>Now let's talk about the game logic :</strong><br>
  I think that a good way to represent these dimensions would be two use two scenes.
  <em>We will call outsideScene the scene for the outside, and insideScene the scene for the inside</em>.<br>
  So if we take again the picture, this would give this at the scene level :
  <img src="https://i.stack.imgur.com/KS7Bd.png" alt="The same image than before, here, all the outside of the ship is colored in green, and the inside that we can see by the doors is colored in yellow, actually the green parts of the images represents the outsideScene (this is the scene that we are in), and the yellow parts (the rectangle of the open doors) represents the insideScene, I want to display this scene in the outsideScene">  </p>
  
  <p>To make it look realistic, the view of the inside needs to follow the movements of the outside camera, that's why I think that all the properties of these two cameras will be identical :
  <img src="https://i.stack.imgur.com/a8kFA.png" alt="enter image description here"><br>
  <img src="https://i.stack.imgur.com/zjwka.png" alt="enter image description here"></p>
  
  <p><em>On the left is the outsideScene and on the right, the insideScene. I represent the camera field of view in orange</em>.  </p>
  
  <p>If the outsideScene camera moves right, the insideScene camera will do exactly the same thing, if the outsideScene camera rotates, the insideScene camera will rotate in the same way... you get the principle.  </p>
  
  <p><strong>So, my question is the following : what can I use to mask a certain portion of a certain scene (in this case the yellow zone in the outsideView) with what the camera of another view (the insideView) "sees" ?</strong><br>
  First, I thought that I could simply get an NSImage from the insideScene and then put it as the texture of a surface in the outsideScene, but the problem would be that Scene Kit would compute it's perspective, lighting etc... so It would just look like we was displaying something on a screen and that's not what I want.</p>