cameraEffect: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(bottom)
m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Arma[ _]2(\|.*)]]" to "{{GameCategory|arma2|Scripting Commands}}")
(28 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{Command|Comments=
____________________________________________________________________________________________
____________________________________________________________________________________________


| ofp |= Game name
| ofp |Game name=


|1.00|= Game version
|1.00|Game version=


|arg= local |= Arguments in MP
|gr1 = Camera Control |GROUP1=


|eff= local |= Effects in MP
|arg= local |Multiplayer Arguments=
 
|eff= local |Multiplayer Effects=
____________________________________________________________________________________________
____________________________________________________________________________________________


| Switch to the given camera or object with the given effect. If you want to switch the screen directly to the first-person, aiming, third-person or group view of an object, use [[switchCamera]] instead. The effect type "Terminate" is used to exit the current camera view and switch back to the player's view. Does not need [[camCommit]].|= Description
| Sets the given effect on the given camera. If you want to switch the screen directly to the first-person, aiming, third-person or group view of an object, use [[switchCamera]] instead. The effect type "Terminate" is used to exit the current camera view and switch back to the player's view. Does not need [[camCommit]].
<br><br>
Since Arma 3 v1.73.142217, it is possible to terminate individual r2t source. For example: <code>cam [[cameraEffect]] ["terminate", "back", "rtt1"]; // would terminate "rtt1" r2t source
cam [[cameraEffect]] ["terminate", "back"]; // would terminate all r2t sources</code><br>
{{Important | One cannot mix and match [[cameraEffect]] and can either have multiple [[r2t]] cameras or a single camera for the whole screen. If one needs a background stream overlayed with [[r2t]] streams, this could be achieved by creating an object and using [[switchCamera]] to switch to it for background image, while using [[cameraEffect]] for [[r2t]] overlay (see Example 4)}}|DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


| camera '''cameraEffect''' [name, position, rtt] |= Syntax
| camera '''cameraEffect''' [effectName, effectPosition, r2tName] |SYNTAX=


|p1= camera: [[Object]] - object of type "camera" |= Parameter 1
|p1= camera: [[Object]] - object of type "camera" |PARAMETER1=


|p2= [name, position]: [[Array]] |= Parameter 2
|p2= [effectName, effectPosition, r2tName]: [[Array]] |PARAMETER2=


|p3= name: [[String]] - the effect type. One of "Internal", "External", "Fixed", "FixedWithZoom" and "Terminate" |= Parameter 3
|p3= effectName: [[String]] - the effect type (defined in main config or [[Description.ext#CfgCameraEffects|CfgCameraEffects]] >> Array). Defaults are: <tt>"Internal"</tt>, <tt>"External"</tt>, <tt>"Fixed"</tt>, <tt>"FixedWithZoom"</tt>, <tt>"Terminate"</tt> |PARAMETER3=


|p4= position: [[String]] - position of the effect. One of "TOP", "BOTTOM", "LEFT", "RIGHT", "FRONT" and "BACK" ("BACK" is normally used) |= Parameter 4
|p4= effectPosition: [[String]] - position of the effect. One of: <tt>"TOP"</tt>, <tt>"LEFT"</tt>, <tt>"RIGHT"</tt>, <tt>"FRONT"</tt>, <tt>"BACK"</tt>, <tt>"LEFT FRONT"</tt>, <tt>"RIGHT FRONT"</tt>, <tt>"LEFT BACK"</tt>, <tt>"RIGHT BACK"</tt>, <tt>"LEFT TOP"</tt>, <tt>"RIGHT TOP"</tt>, <tt>"FRONT TOP"</tt>, <tt>"BACK TOP"</tt>, <tt>"BOTTOM"</tt>. These are usually used with "Fixed" and "FixedWithZoom" effect types. If not sure which position to use, set it to "BACK"; |PARAMETER4=
|p5= rtt: [[String]] - (optional) [[Procedural_Textures#Render_To_Texture|Render To Texture]] surface reference |= Parameter 5


| [[Nothing]] |= Return value
|p5= r2tName (Optional): [[String]] - [[Procedural_Textures#Render_To_Texture|Render To Texture]] surface reference |PARAMETER5=
 
| [[Nothing]] |RETURNVALUE=
____________________________________________________________________________________________
____________________________________________________________________________________________
   
   
|x1= <code>_cam [[cameraEffect]] ["internal", "BACK"];</code> |= Example 1
|x1= <code>_cam [[cameraEffect]] ["internal", "BACK"];</code> |EXAMPLE1=
|x2= <code>_cam [[cameraEffect]] ["internal", "back", "rendersurface"];</code> |= Example 1
|x2= <code>_cam [[cameraEffect]] ["internal", "back", "rendersurface"];</code> |EXAMPLE2=
|x3= <code>cam = "seagull" [[camCreate]] ([[player]] [[modelToWorld]] [0,0,100]);
cam [[cameraEffect]] ["FIXED", "LEFT TOP"];
cam [[camCommand]] "MANUAL ON";</code> |EXAMPLE3=
|x4= <code>_ctrl = [[findDisplay]] 46 [[createDisplay]] "RscDisplayEmpty" [[ctrlCreate]] ["RscPicture", -1];
_ctrl [[ctrlSetPosition]] [0.5, 0, 0.5, 0.5];
_ctrl [[ctrlSetText]] "#(argb,512,512,1)r2t(rtt1,1.0)";
_ctrl [[ctrlCommit]] 0;
_cam1 = "camera" [[camCreate]] ([[ASLtoAGL]] [[eyePos]] [[player]] [[vectorAdd]] [0, -10, 0]);
_cam1 [[cameraEffect]] ["Internal", "Back", "rtt1"];
_cam2 = "Land_HandyCam_F" [[createVehicle]] [0,0,0];
_cam2 [[enableSimulation]] false;
_cam2 [[setPos]] ([[ASLtoAGL]] [[eyePos]] [[player]] [[vectorAdd]] [0, 10, 0]);
_cam2 [[setDir]] (_cam2 [[getDir]] [[player]]);
[[switchCamera]] _cam2;</code> |EXAMPLE4=
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[switchCamera]], [[setCameraEffect]], [[cameraView]], [[cameraOn]], [[setPiPEffect]] |= See also
| [[switchCamera]], [[cameraView]], [[cameraOn]], [[setPiPEffect]], [[camCreate]], [[cameraEffectEnableHUD]], [[camUseNVG]], [[setCamUseTI]] |SEEALSO=


}}
}}
Line 49: Line 70:
[[Category:Scripting Commands OFP 1.96|CAMERAEFFECT]]
[[Category:Scripting Commands OFP 1.96|CAMERAEFFECT]]
[[Category:Scripting Commands OFP 1.46|CAMERAEFFECT]]
[[Category:Scripting Commands OFP 1.46|CAMERAEFFECT]]
[[Category:Scripting Commands ArmA|CAMERAEFFECT]]
{{GameCategory|arma1|Scripting Commands}}
[[Category:Command Group: Camera Control|CAMERAEFFECT]]
{{GameCategory|arma2|Scripting Commands}}
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
{{GameCategory|arma3|Scripting Commands}}
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
{{GameCategory|tkoh|Scripting Commands}}
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
 
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on October 30, 2016 - 16:40 (UTC)</dd>
<dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt>
<dd class="note">
Types of camera for [[Description.ext#CfgCameraEffects|CfgCameraEffects]] config:
* CamExternal (CamInterpolated) <tt>type <nowiki>=</nowiki> 0;</tt> // linked directly with object
* CamStatic <tt>type <nowiki>=</nowiki> 1;</tt> // fixed point in space
* CamStaticWithZoom <tt>type <nowiki>=</nowiki> 2;</tt> // fixed point in space
* CamChained <tt>type <nowiki>=</nowiki> 3;</tt> // chained
* CamTerminate <tt>type <nowiki>=</nowiki> 4;</tt> // terminate
* CamInternal <tt>type <nowiki>=</nowiki> 5;</tt> // internal view
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Revision as of 04:11, 8 January 2021

Hover & click on the images for description

Description

Description:
Sets the given effect on the given camera. If you want to switch the screen directly to the first-person, aiming, third-person or group view of an object, use switchCamera instead. The effect type "Terminate" is used to exit the current camera view and switch back to the player's view. Does not need camCommit.

Since Arma 3 v1.73.142217, it is possible to terminate individual r2t source. For example: cam cameraEffect ["terminate", "back", "rtt1"]; // would terminate "rtt1" r2t source cam cameraEffect ["terminate", "back"]; // would terminate all r2t sources
One cannot mix and match cameraEffect and can either have multiple r2t cameras or a single camera for the whole screen. If one needs a background stream overlayed with r2t streams, this could be achieved by creating an object and using switchCamera to switch to it for background image, while using cameraEffect for r2t overlay (see Example 4)
Groups:
Camera Control

Syntax

Syntax:
camera cameraEffect [effectName, effectPosition, r2tName]
Parameters:
camera: Object - object of type "camera"
[effectName, effectPosition, r2tName]: Array
effectName: String - the effect type (defined in main config or CfgCameraEffects >> Array). Defaults are: "Internal", "External", "Fixed", "FixedWithZoom", "Terminate"
effectPosition: String - position of the effect. One of: "TOP", "LEFT", "RIGHT", "FRONT", "BACK", "LEFT FRONT", "RIGHT FRONT", "LEFT BACK", "RIGHT BACK", "LEFT TOP", "RIGHT TOP", "FRONT TOP", "BACK TOP", "BOTTOM". These are usually used with "Fixed" and "FixedWithZoom" effect types. If not sure which position to use, set it to "BACK";
r2tName (Optional): String - Render To Texture surface reference
Return Value:
Nothing

Examples

Example 1:
_cam cameraEffect ["internal", "BACK"];
Example 2:
_cam cameraEffect ["internal", "back", "rendersurface"];
Example 3:
cam = "seagull" camCreate (player modelToWorld [0,0,100]); cam cameraEffect ["FIXED", "LEFT TOP"]; cam camCommand "MANUAL ON";
Example 4:
_ctrl = findDisplay 46 createDisplay "RscDisplayEmpty" ctrlCreate ["RscPicture", -1]; _ctrl ctrlSetPosition [0.5, 0, 0.5, 0.5]; _ctrl ctrlSetText "#(argb,512,512,1)r2t(rtt1,1.0)"; _ctrl ctrlCommit 0; _cam1 = "camera" camCreate (ASLtoAGL eyePos player vectorAdd [0, -10, 0]); _cam1 cameraEffect ["Internal", "Back", "rtt1"]; _cam2 = "Land_HandyCam_F" createVehicle [0,0,0]; _cam2 enableSimulation false; _cam2 setPos (ASLtoAGL eyePos player vectorAdd [0, 10, 0]); _cam2 setDir (_cam2 getDir player); switchCamera _cam2;

Additional Information

See also:
switchCameracameraViewcameraOnsetPiPEffectcamCreatecameraEffectEnableHUDcamUseNVGsetCamUseTI

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Bottom Section

Posted on October 30, 2016 - 16:40 (UTC)
Killzone Kid
Types of camera for CfgCameraEffects config:
  • CamExternal (CamInterpolated) type = 0; // linked directly with object
  • CamStatic type = 1; // fixed point in space
  • CamStaticWithZoom type = 2; // fixed point in space
  • CamChained type = 3; // chained
  • CamTerminate type = 4; // terminate
  • CamInternal type = 5; // internal view