Jump to content
zigzagtshirt

PIP on TV monitor help

Recommended Posts

I have the dual-screen monitor object placed in mission. I have successfully created a "PIP camera" and attached it to the first monitor.  However, when I create a separate, distinct instance of another one and try to attach it to the second monitor, all I get is the first monitor mirrored on the second instead of the different camera.  What am I doing wrong?  I feel silly for asking.  Here are my scripts:

 

//Camera 1

 

_screen = tv1;
_screen setObjectTexture [0, "#(argb,512,512,1)r2t(piprendertg,1)"];

_pipcam = "camera" camCreate [0,0,0];


// set exact yaw, pitch, and roll
_y = 72; _p = -27; _r = 0;
_pipcam setVectorDirAndUp [
    [ sin _y * cos _p,cos _y * cos _p,sin _p],
    [ [ sin _r,-sin _p,cos _r * cos _p],-_y] call BIS_fnc_rotateVector2D
];

_pipcam cameraEffect ["Internal", "Back", "piprendertg"];
_pipcam camSetFov 0.75;

_campos = [11441.9,14226.4,12.213];
_campos set [2,12.213];
_pipcam setpos _campos;

 

/////////////////////////////////////////////////////////////////////////////////////////////////////////

 

//Camera 2

 

_screen2 = tv1;
_screen2 setObjectTexture [1, "#(argb,512,512,1)r2t(piprendertg,1)"];

_pipcam2 = "camera" camCreate [0,0,0];


// set exact yaw, pitch, and roll
_y = 229; _p = -29; _r = 0;
_pipcam2 setVectorDirAndUp [
    [ sin _y * cos _p,cos _y * cos _p,sin _p],
    [ [ sin _r,-sin _p,cos _r * cos _p],-_y] call BIS_fnc_rotateVector2D
];

_pipcam2 cameraEffect ["Internal", "Back", "piprendertg"];
_pipcam2 camSetFov 0.75;

_campos2 = [11460.2,14242.3,17.1712];
_campos2 set [1,17.1712];
_pipcam2 setpos _campos2;
 

 

 

 

 

Share this post


Link to post
Share on other sites

Is it because both _screen1 and _screen2 are set to same tv1 object?

  • Like 1

Share this post


Link to post
Share on other sites

It's not obvious at first, but you need individual render targets, in your case "piprendertg":

_pipcam1 cameraEffect ["Internal", "Back", "piprendertg1"];
 _screen1 setObjectTexture [0, "#(argb,512,512,1)r2t(piprendertg1,1)"]; 

_pipcam2 cameraEffect ["Internal", "Back", "piprendertg2"];
 _screen1 setObjectTexture [1, "#(argb,512,512,1)r2t(piprendertg2,1)"]; 
//etc.

Cheers

  • Like 1

Share this post


Link to post
Share on other sites
27 minutes ago, johnnyboy said:

Is it because both _screen1 and _screen2 are set to same tv1 object?

 

script 1:

_screen setObjectTexture [0, "#(argb,512,512,1)r2t(piprendertg,1)"];

 

script 2:

 

_screen2 setObjectTexture [1, "#(argb,512,512,1)r2t(piprendertg,1)"];

 

tv1 object is a dual screen monitor. The 0 refers to left screen; 1 refers to right screen.

 

I even tested this with two completely different objects and the first camera was still mirrored across both.

Share this post


Link to post
Share on other sites
2 minutes ago, Grumpy Old Man said:

It's not obvious at first, but you need individual render targets, in your case "piprendertg":


_pipcam1 cameraEffect ["Internal", "Back", "piprendertg1"];
 _screen1 setObjectTexture [0, "#(argb,512,512,1)r2t(piprendertg1,1)"]; 

_pipcam2 cameraEffect ["Internal", "Back", "piprendertg2"];
 _screen1 setObjectTexture [1, "#(argb,512,512,1)r2t(piprendertg2,1)"]; 
//etc.

Cheers

 

Womp womp. I knew it was something stupid. I was hoping you'd be around to set me straight, Grumpy. THANK YOU!

  • Like 2

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×