positionCameraToWorld: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "(\|[pr][0-9]+ *= *[^-]+) *- *C([a-eg-z])" to "$1 - c$2") |
Lou Montana (talk | contribs) m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *R([a-z ])" to "$1 - r$2") |
||
Line 26: | Line 26: | ||
|s1= [[positionCameraToWorld]] cameraPos | |s1= [[positionCameraToWorld]] cameraPos | ||
|p1= cameraPos: [[Position#PositionRelative|PositionRelative]] - | |p1= cameraPos: [[Position#PositionRelative|PositionRelative]] - relative camera position, format [x, z, y]{{Feature | important | Note that y and z for this command are swapped around, which is different from your usual model space coordinates format}} | ||
|r1= [[Array]] - camera world position, format [[Position#PositionAGL|PositionAGL]] | |r1= [[Array]] - camera world position, format [[Position#PositionAGL|PositionAGL]] |
Revision as of 15:47, 8 November 2023
Description
- Description:
- Transforms position from camera coordinate space to world coordinate space. Camera axes are relative to camera orientation. x axis goes from left of the camera to right of the camera, z axis goes from underneath the camera to above the camera and y axis goes from back of the camera to where the camera is looking.
- Groups:
- Camera ControlPositions
Syntax
- Syntax:
- positionCameraToWorld cameraPos
- Parameters:
- cameraPos: PositionRelative - relative camera position, format [x, z, y]
- Return Value:
- Array - camera world position, format PositionAGL
Examples
- Example 1:
- Example 2:
- Example demonstrating reversed y and z:
Additional Information
- See also:
- modelToWorld modelToWorldVisual getCameraViewDirection weaponDirection eyeDirection vectorDir vectorDirVisual
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 Oct 17, 2008 - 11:25 (UTC)
- By measuring the distance between the camera and the player one can determine whether 1st-person or 3rd-person view is being used:
- Posted on Oct 17, 2010 - 22:45 (UTC)
-
The camera coordinate system is different from the model coordinate system: when modelToWorld uses [x, y, z] then positionCameraToWorld uses [x, z, y]. So for a steady camera the following is true:
Categories:
- Scripting Commands
- Introduced with Armed Assault version 1.00
- ArmA: Armed Assault: New 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
- Command Group: Positions