cameraEffect: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Added SEEALSO)
m (Text replacement - "{{HashLink" to "{{Link")
 
(106 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| ofp |= Game name
|game1= ofp
|version1= 1.00


|1.00|= Game version
|game2= ofpe
|version2= 1.00


|arg= local |= Arguments in MP
|game3= arma1
|version3= 1.00


|eff= local |= Effects in MP
|game4= arma2
____________________________________________________________________________________________
|version4= 1.00


| 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.Needs the call of [[camCommit]] to be conducted. |= Description
|game5= arma2oa
____________________________________________________________________________________________
|version5= 1.50


| camera '''cameraEffect''' [name, position] |= Syntax
|game6= tkoh
|version6= 1.00


|p1= camera: [[Object]] - object of type "camera" |= Parameter 1
|game7= arma3
|version7= 0.50


|p2= [name, position]: [[Array]] |= Parameter 2
|gr1= Camera Control


|p3= name: [[String]] - the effect type. One of "Internal", "External", "Fixed", "FixedWithZoom" and "Terminate" |= Parameter 3
|arg= local


|p4= position: [[String]] - position of the effect. One of "TOP", "LEFT", "RIGHT", "FRONT" and "BACK" ("BACK" is normally used) |= Parameter 4
|eff= local


| [[Nothing]] |= Return value
|descr= 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 {{GVI|arma3|1.74}}, it is possible to terminate individual r2t source. For example:
|x1= <pre>_cam cameraEffect ["internal", "BACK"]</pre> |= Example 1
<sqf>
____________________________________________________________________________________________
cam cameraEffect ["terminate", "back", "rtt1"]; // would terminate "rtt1" r2t source
cam cameraEffect ["terminate", "back"]; // would terminate all r2t sources
</sqf>
{{Feature|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 {{Link|#Example 4}}).
}}


| [[switchCamera]], [[cameraView]], [[cameraOn]] |= See also
|s1= camera [[cameraEffect]] [effectName, effectPosition, r2tName]


|p1= camera: [[Object]] - object of type "camera"
|p2= effectName: [[String]] - the effect type (defined in main config or [[Description.ext#CfgCameraEffects|CfgCameraEffects]] >> Array). Defaults are: {{hl|"Internal"}}, {{hl|"External"}}, {{hl|"Fixed"}}, {{hl|"FixedWithZoom"}}, {{hl|"Terminate"}}
|p3= effectPosition: [[String]] - position of the effect. Can be one of:
{{Columns|5|
* {{hl|"TOP"}}
* {{hl|"LEFT"}}
* {{hl|"RIGHT"}}
* {{hl|"FRONT"}}
* {{hl|"BACK"}}
* {{hl|"LEFT FRONT"}}
* {{hl|"RIGHT FRONT"}}
* {{hl|"LEFT BACK"}}
* {{hl|"RIGHT BACK"}}
* {{hl|"LEFT TOP"}}
* {{hl|"RIGHT TOP"}}
* {{hl|"FRONT TOP"}}
* {{hl|"BACK TOP"}}
* {{hl|"BOTTOM"}}
}}
}}
These are usually used with "Fixed" and "FixedWithZoom" effect types. If not sure which position to use, set it to {{hl|"BACK"}}.


<h3 style="display:none">Notes</h3>
|p4= r2tName: [[String]] - (Optional) [[Procedural_Textures#Render_To_Texture|Render To Texture]] surface reference
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|r1= [[Nothing]]
</dl>


<h3 style="display:none">Bottom Section</h3>
|x1= <sqf>_cam cameraEffect ["internal", "BACK"];</sqf>


[[Category:Scripting Commands|CAMERAEFFECT]]
|x2= <sqf>_cam cameraEffect ["internal", "back", "rendersurface"];</sqf>
[[Category:Scripting Commands OFP 1.96|CAMERAEFFECT]]
 
[[Category:Scripting Commands OFP 1.46|CAMERAEFFECT]]
|x3= <sqf>
[[Category:Scripting Commands ArmA|CAMERAEFFECT]]
cam = "seagull" camCreate (player modelToWorld [0,0,100]);
[[Category:Command Group: Camera Control|CAMERAEFFECT]]
cam cameraEffect ["FIXED", "LEFT TOP"];
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
cam camCommand "MANUAL ON";
</sqf>
 
|x4= <sqf>
_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;
</sqf>
 
|seealso= [[switchCamera]] [[cameraView]] [[cameraOn]] [[setPiPEffect]] [[camCreate]] [[cameraEffectEnableHUD]] [[camUseNVG]] [[setCamUseTI]]
}}
 
{{Note
|user= Killzone_Kid
|timestamp= 20161030164000
|text= Types of camera for [[Description.ext#CfgCameraEffects|CfgCameraEffects]] config:
* CamExternal (CamInterpolated) {{hl|c= type = 0;}} // linked directly with object
* CamStatic {{hl|c= type = 1;}} // fixed point in space
* CamStaticWithZoom {{hl|c= type = 2;}} // fixed point in space
* CamChained {{hl|c= type = 3;}} // chained
* CamTerminate {{hl|c= type = 4;}} // terminate
* CamInternal {{hl|c= type = 5;}} // internal view
}}

Latest revision as of 18:43, 4 January 2023

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 logo black.png1.74, 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: String - the effect type (defined in main config or CfgCameraEffects >> Array). Defaults are: "Internal", "External", "Fixed", "FixedWithZoom", "Terminate"
effectPosition: String - position of the effect. Can be 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: String - (Optional) 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:
switchCamera cameraView cameraOn setPiPEffect camCreate cameraEffectEnableHUD camUseNVG setCamUseTI

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
Killzone_Kid - c
Posted on Oct 30, 2016 - 16:40 (UTC)
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