I’ve recently tried adding a cameranode to my PiP camera, so to make it follow the selected spatial. The Picture-in-Picture camera is working fine, but as the entity I’m pointing the PiP-camera at is moving, it’s not much good. Now, adding the cameranode seems okay, however when I add the following line:
selectedSpatial.getParent().attachChild(camNode);
The picture in picture-viewport is all black. The node i’m moving is the parent of the spatial.
I’m running out of ideas. You can see my code here:
Maybe your camera “lookAt” to a wrong direction (if you have no background, it’s black), mimic the direction (rotation) of parent should be not what you whish. You can try to add a Control to your CameraNode, to force it to “lookAt” your player or your selectedSpatial.
black is the default color when the screen is cleared. Ambient is only applied on materials that that take care of it. So ambient as no impact on the clear/background color.
Did you try to force lookat to selectedSpatial (every frame) ?
Did you try to define the rootNode for the viewport of cam2 ?
What I meant by having an ambient light is that my scene, when playing the game, has no black anywhere. I can post a screenshot when I get back to you.
Hi, I’m heaving a very similar problem. I also tried setting the background color to pink as @david_bernard_31 mentioned. The rendering is still black. Have you found a solution for your problem, @asser_fahrenholz?
The main camera can see all the objects just fine. When I then click an object the PiP-camera should show the object chosen in a smaller viewport in the corner (they are basic ‘boxes’ - no fancy stuff).