Hiya @ilia, welcome to the BJS forum.
I’m the author of that playground (with help from many)… so I can help ya.
https://www.babylonjs-playground.com/#1WROZH#70
A little better.
In the #14 playground, all 4 “renderTargetTextures” (rtt) and a black plane called butback … were parented to the main camera. That is why they seemed “stuck-to” the camera. They are difficult to position when that parenting exists.
In the #70 playground… line 71 shows that monitor #2 (the minimap plane) is still parented to camera. This method of keeping the mini-map in upper corner… is not real good. We have had reports of trouble… when using assorted/varied canvas sizes (or resizes). In line 57, I ATTEMPTED to position monitor2 based-upon the current canvas size. This may need tweaking, or maybe needs to use a different method.
There is another way to make mini-maps, and that is… using a “viewport”.
https://www.babylonjs-playground.com/#1OQMIG#2
I am far from a pro. Here is a playground search for ‘minimap’. It returns a few demo scenes. You should tour them.
A search for ‘minimap’ on our previous forum… returns many hits.
www.html5gamedevs.com/search/?&q=minimap&type=forums_topic&nodes=28,29,30,31,38
Again, my 4-renderTargetTexture playground/methods might not be the best way to do a minimap. I suggest touring-around for better methods. Viewports are very nice. They do well with canvas resizes… but they are a challenge to put a border-around.
Once, I made a 3-viewport playground, but then I added two more viewports… just for drawing blue divider lines.
https://www.babylonjs-playground.com/#13TVWJ#2
The 2 blue lines… are actually cameras/thin-viewports… aimed at a blue plane, which is placed far away from main scene. I made this PG a LONG time ago, before the invention of layerMasks. LayerMasks could probably prevent the need to move the “blue line camera” far away (hide it).
During your experiments, you will work-with three “camera directives” that are each quite important and adjustable:
- somecamera.attachControl(canvas) // you can do this to many cameras… or one.
- scene.activeCamera = somecamera; // always one camera
- scene.activeCameras = [camera, camera2, camera3] // array of one or many cameras. The ORDER of the cameras MIGHT matter (I can’t remember). You’ll often see cameras pushed into this array, but feel free to force it however you wish.
It will take some time and experimenting… to get your cameras the way you wish. In the #70 demo, notice that line 10 is disabled. Instead, in line 134, I CONSTANTLY set camera2.alpha (orbital spin) = camera.alpha. This way, main camera can move freely, but minimap camera2 can only spin, and never tilt or mousewheel-zoom.
Ok, I hope this helps. Stay tuned for more comments and likely some great mini-map demos.