camSetDir: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\[\[Category:Scripting Commands OFP 1.[4-9]{2}(\|(\{\{uc:\{\{PAGENAME\}\}\}\}|#|[A-Z]+))?\]\] " to "") |
Lou Montana (talk | contribs) (Some wiki formatting - re adding camSetDir number syntax) |
||
Line 1: | Line 1: | ||
{{RV|type=command | {{RV|type=command | ||
| ofp | |game1= ofp | ||
|version1= 1.00 | |||
|1.00 | |game2= ofpe | ||
|version2= 1.00 | |||
|game3= arma1 | |||
|version3= 1.00 | |||
|game4= arma2 | |||
|version4= 1.00 | |||
|game5= arma2oa | |||
|version5= 1.51 | |||
|game6= tkoh | |||
|version6= 1.00 | |||
|game7= arma3 | |||
|version7= 0.50 | |||
|gr1 = Camera Control | |gr1 = Camera Control | ||
Line 11: | Line 28: | ||
|eff= local | |eff= local | ||
| Sets the orientation of the given camera in the direction of the given vector. Needs [[camCommit]]. | |descr= Sets the orientation of the given camera in the direction of the given vector. Needs [[camCommit]]. | ||
| camera | |s1= camera [[camSetDir]] direction | ||
|p1= camera: [[Object]] - object of type "camera" | |p1= camera: [[Object]] - object of type "camera" | ||
|p2= direction: [[Array]] in format [x,y,z] - direction of camera. Must be a valid vector. | |p2= direction: | ||
* [[Number]] (before {{GVI|arma3|0.50}}) - camera azimuth | |||
* [[Array]] in format [x,y,z] (since {{GVI|arma3|0.50}}) - direction of camera. Must be a valid vector. | |||
| [[Nothing]] | |r1= [[Nothing]] | ||
|x1= <code> | |x1= Since {{arma3}}:<code>[[private]] _pos1 = [[player]] [[modelToWorld]] [0, 5, 5]; | ||
[[private]] _pos2 = [[player]] [[modelToWorld]] [0, 50, 50]; | |||
| | [[private]] _cam = "camera" [[camCreate]] _pos1; | ||
_cam [[cameraEffect]] ["INTERNAL", "BACK"]; | |||
_cam [[camSetPos]] _pos2; | |||
_cam [[camSetDir]] (_pos2 [[vectorFromTo]] _pos1); | |||
_cam [[camCommit]] 5; | |||
[[waitUntil]] { [[camCommitted]] _cam }; | |||
_cam [[camSetPos]] _pos1; | |||
_cam [[camCommit]] 5; | |||
</code> | |||
|x2= Before {{arma3}}:<code>[[private]] _pos1 = [[player]] [[modelToWorld]] [0, 5, 5]; | |||
[[private]] _pos2 = [[player]] [[modelToWorld]] [0, 50, 50]; | |||
[[private]] _cam = "camera" [[camCreate]] _pos1; | |||
_cam [[cameraEffect]] ["INTERNAL", "BACK"]; | |||
_cam [[camSetPos]] _pos2; | |||
_cam [[camSetDir]] 180; | |||
_cam [[camCommit]] 5; | |||
[[waitUntil]] { [[camCommitted]] _cam }; | |||
_cam [[camSetPos]] _pos1; | |||
_cam [[camCommit]] 5; | |||
</code> | |||
|seealso= [[direction]], [[setDir]], [[camSetTarget]] | |||
}} | |||
<!-- CONTINUE Notes --> | <!-- CONTINUE Notes --> |
Revision as of 11:33, 1 April 2021
Description
- Description:
- Sets the orientation of the given camera in the direction of the given vector. Needs camCommit.
- Groups:
- Camera Control
Syntax
- Syntax:
- camera camSetDir direction
- Parameters:
- camera: Object - object of type "camera"
- direction:
- Return Value:
- Nothing
Examples
- Example 1:
- Since Arma 3:
private _pos1 = player modelToWorld [0, 5, 5]; private _pos2 = player modelToWorld [0, 50, 50]; private _cam = "camera" camCreate _pos1; _cam cameraEffect ["INTERNAL", "BACK"]; _cam camSetPos _pos2; _cam camSetDir (_pos2 vectorFromTo _pos1); _cam camCommit 5; waitUntil { camCommitted _cam }; _cam camSetPos _pos1; _cam camCommit 5;
- Example 2:
- Before Arma 3:
private _pos1 = player modelToWorld [0, 5, 5]; private _pos2 = player modelToWorld [0, 50, 50]; private _cam = "camera" camCreate _pos1; _cam cameraEffect ["INTERNAL", "BACK"]; _cam camSetPos _pos2; _cam camSetDir 180; _cam camCommit 5; waitUntil { camCommitted _cam }; _cam camSetPos _pos1; _cam camCommit 5;
Additional Information
- See also:
- directionsetDircamSetTarget
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
- Posted on May 9, 2016 - 19:47 (UTC)
- Killzone Kid
- cameraEffect "INTERNAL" works better than "EXTERNAL" with this command.
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint version 1.00
- Operation Flashpoint: New Scripting Commands
- Operation Flashpoint: Scripting Commands
- Operation Flashpoint: Elite: Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Camera Control
- Scripting Commands: Local Effect