Jump to content
Sign in to follow this  
Noigel

BIS_fnc_PIP Problem: How can I change the "focus point" of the camera?

Recommended Posts

I've created a BIS_fnc_PIP camera that I want to use to show the entire body of a virtual solider that's been created as a target.  The problem is that, no matter where the _pipcamVehicle object is positioned, the camera always angles to focus on the soldier's head.  Because of this I can't get his entire body into the picture in a way that would look good for target assessment.  Here's the main piece of code:

 

if (_rangeTarget isKindOf "C_Soldier_VR_F") then {

 

_pipcamVehicle = createVehicle ["Sign_Sphere10cm_F", [0,0,0], [], 0, "CAN_COLLIDE"];

_pipcamVehicle setObjectTextureGlobal [0,"#(argb,8,8,3)color(0,0,0,0)"];

 

_pos = getPosATL _rangeTarget vectorAdd [0, -2, 0.5];  //this is where I've been trying to make adjustments 

_pipcamVehicle setPos _pos;

 

_camPos = ([0,0,0]);

_pipcamVehicle attachTo [_rangeTarget];

 

_pipcamObject = ["renderPIPtarget0",[[_pipcamVehicle,_camPos],_rangeTarget],_pipcamVehicle] call BIS_fnc_PIP;


//Larrow's awesome code for resizing pipcam displays:  https://forums.bistudio.com/topic/182321-increasing-bis-fnc-livefeed-display-size/
[[safezoneX + safezoneW - 0.39, safezoneY + safezoneH - 0.38], 1.8 ] call fnc_resizePIP;  

_pipcamObject camCommit 0;
};

 

I've tried various combinations of:

 

_pos = getPosATL _prevrangeTarget vectorAdd [?, ?, ?];

 

...and they all center on his head.  Check out the examples below:

 

Example 1

_pos = getPosATL _prevrangeTarget vectorAdd [0, -2, 0.5];

BFyUA54.png

 

Example 2

_pos = getPosATL _prevrangeTarget vectorAdd [0, -1.5, 3];

kkyLpuA.png

 

Example 3

_pos = getPosATL _prevrangeTarget vectorAdd [0, -1.5, 1.5];

WriNuft.png

 

This last position / image is by far the best in my opinion but I would like to have his legs in the picture too.  I'm hoping there is some way to change the camera focus from his head to somewhere on his torso so that his body is completely in the shot.  Has anyone been able to change where the camera focuses when attaching camera source to target?

 

Also Larrow's "livefeed" size and position change script is great.  Is there a way though to keep from seeing the pipcam for a split second as the function changes the cam properties?  See below:

Ese5yPg.gif

 

Thanks, -Noigel

Share this post


Link to post
Share on other sites

Basically instead of trying to get the PIPcam to focus on a particular part of the soldier target... I made it focus on an invisible helper object that I attached to the soldier target.  With the attachTo command I was able to offset the exact location of the helper object with great precision and the soldier was just millimeters behind that.  I then used x,y,z positional adjustments of both the pipcam "source" object and the helper "target" object to "fill up" the pipcam's screen real estate with as much of the soldier as possible without having parts of his head or feet going offscreen.

 

My only complaint is that the PIPcam is a bit wall-eyed... not a big issue but something noticeable.  The soldier looks good but larger object almost appear to bend backwards in a convex fashion.     

  • 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
Sign in to follow this  

×