Jump to content
Barba-negra

create two cameras on different screens each

Recommended Posts

Hi guys, how are you? I have a problem, I am trying to create two cameras for each screen each, but when I try, they both show the same screen despite the fact that I am placing the screens separately, what is happening, I am using the following code:

 

scripts1:

 

[[],"camara1.sqf"] remoteExec ["BIS_fnc_execVM",0];

 

vistaentrada setObjectTexture [0, '#(argb,512,512,1)r2t(piprendertg,1)'];
 
cam = 'camera' camCreate [0,0,0]; 
cam cameraEffect ['internal', 'Back', 'piprendertg']; 
 
for '_i' from 1 to 2 do {   
CAM attachto [cam01,[0,0,0.1]];    
CAM setVectorDirAndUp [[-3.0,1.35,109.8],[-10.9,84.04,14.99]];   
};

 

scripts2:

 

[[],"camara2.sqf"] remoteExec ["BIS_fnc_execVM",0];

 

vistaAfuera setObjectTexture [0, '#(argb,512,512,1)r2t(uavrtt,1)'];

 

cam_03 = 'camera' camCreate [0,0,0];
cam_03 cameraEffect ['internal', 'Back', 'uavrtt'];

 

for '_i' from 1 to 2 do {   
CAM_03 attachto [cam03,[0,0,2.33]];    
CAM_03 setVectorDirAndUp [[12.0,1.35,-80.8],[-5.9,84.04,24.99]];   
}; 

 

 

 

Share this post


Link to post
Share on other sites

If we can guess that vistaentrada and vistaAfuera  are two screens, cam01 is ... an object, cam03 an UAV,   so test:

 

if (isServer) then {
  _cam = 'camera' camCreate [0,0,0];   
  _cam cameraEffect ['internal', 'Back', 'piprendertg'];
  _cam camSetTarget cam03;
  _cam attachto [cam01,[0,0,0.1]];     

  vistaentrada setObjectTextureGlobal [0, '#(argb,512,512,1)r2t(piprendertg,1)'];
 
  _cam_03 = 'camera' camCreate [0,0,0];
  _cam_03 cameraEffect ['internal', 'Back', 'uavrtt'];

  _cam_03 camSetTarget cam01;
  _cam_03 attachTo [cam03,[0,0,2.33]];
  vistaAfuera setObjectTextureGlobal [0, '#(argb,512,512,1)r2t(uavrtt,1)'];


_cam camCommit 1;
_cam_03 camCommit 1;
  };

 

Now cam01 will follow cam03 (UAV) and cam03 will follow cam01.
 

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
2 hours ago, pierremgi said:

Si podemos adivinar que vistaentrada y vistaAfuera son dos pantallas, cam01 es ... un objeto, cam03 un UAV, así que pruebe:

 

if (isServer) entonces {
  _cam = 'camera' camCreate [0,0,0];   
  _cam cameraEffect ['interno', 'Atrás', 'piprendertg'];
  _cam camSetTarget cam03;
  _cam attachto [cam01, [0,0,0.1]];     

  vistaentrada setObjectTextureGlobal [0, '# (argb, 512,512,1) r2t (piprendertg, 1)'];
 
  _cam_03 = 'cámara' camCreate [0,0,0];
  _cam_03 cameraEffect ['interno', 'Atrás', 'uavrtt'];

  _cam_03 camSetTarget cam01;
  _cam_03 attachTo [cam03, [0,0,2.33]];
  vistaAfuera setObjectTextureGlobal [0, '# (argb, 512,512,1) r2t (uavrtt, 1)'];


_cam camCommit 1;
_cam_03 camCommit 1;
  };

 

Ahora cam01 seguirá a cam03 (UAV) y cam03 seguirá a cam01.
 

 

ohhh mister @pierremgi What a pleasure to talk to you again, hehehe, you helped me a lot with my project, currently I am still improving it, I invite you to try it.

 

https://steamcommunity.com/sharedfiles/filedetails/?id=2107281042

 

regarding the cameras, is there the possibility of having more than two cameras? I was thinking of having 5 cameras, but I have some doubts about that, what does this mean piprendertg and uavrtt? and can I have this repeated for other cameras? or must they be different?

Share this post


Link to post
Share on other sites

Another question about cameras, is there a maximum distance that the object can for transmission on screen  on a dedicated server?

Share this post


Link to post
Share on other sites

lol, I rarely script for cams... 2017 was my last one.

 

Well, first of all, I hope somebody else will answer, with exact terms.

 

On my mind, there is not so much restriction for the numbers of cameras. Your FPS will drop down with PIPs I guess. An average of 4 shouldn't impact too much current hardware.

For the distance, you can target what you want (if exists), but the rendering on screen will be limited by video setting (max distance for objects). You can code that for a server (as max) but each players will have one more limitation with their own card setting.

 

  • Like 1

Share this post


Link to post
Share on other sites
5 minutes ago, pierremgi said:

lol, I rarely script for cams... 2017 was my last one.

 

Well, first of all, I hope somebody else will answer, with exact terms.

 

On my mind, there is not so much restriction for the numbers of cameras. Your FPS will drop down with PIPs I guess. An average of 4 shouldn't impact too much current hardware.

For the distance, you can target what you want (if exists), but the rendering on screen will be limited by video setting (max distance for objects). You can code that for a server (as max) but each players will have one more limitation with their own card setting.

 

Now I understand, I will review that and do the necessary tests, thank you for your time, sir @pierremgi :)

Share this post


Link to post
Share on other sites
Hace 3 horas, pierremgi dijo:

jajaja, rara vez escribo para cámaras ... 2017 fue mi último.

 

Bueno, antes que nada, espero que alguien más responda, con términos exactos.

 

En mi opinión, no hay tanta restricción para el número de cámaras. Supongo que su FPS se desplegará con PIP. Un promedio de 4 no debería afectar demasiado el hardware actual.

Para la distancia, puede apuntar a lo que desee (si existe), pero la representación en pantalla estará limitada por la configuración de video (distancia máxima para objetos). Puede codificar eso para un servidor (como máximo), pero cada jugador tendrá una limitación más con su propia configuración de tarjeta.

 

 @pierremgi However, something strange is happening, after a period of transmission the screens turn black and no longer transmit the image, why is this happening?

Share this post


Link to post
Share on other sites
5 hours ago, pierremgi said:

:headscratch:  Sorry, no idea.

I understand is fine my friend

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

×