positionCameraToWorld: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
(1st/3rd person view determination (thanks, Zayfod!))
Line 25: Line 25:
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->
<dd class="notedate">Posted on October 17, 2008 - 11:25</dd>
<dt class="note">'''[[User:Kronzky|Kronzky]]'''</dt>
<dd class="note">
By measuring the distance between the camera and the player one can determine whether 1st-person or 3rd-person view is being used:
<pre>if ((positionCameraToWorld [0,0,0] distance player)>2) then {hint "3rd person"} else {hint "1st person"}</pre>
</dd>


<!-- Note Section END -->
<!-- Note Section END -->

Revision as of 17:54, 17 October 2008

-wrong parameter ("Arma") defined!-1.00
Hover & click on the images for description

Description

Description:
Transform position from camera coordinate space to world coordinate space.
Groups:
Uncategorised

Syntax

Syntax:
Position= positionCameraToWorld Position
Return Value:
Array

Examples

Example 1:
_worldPos = positionCameraToWorld _cameraPos

Additional Information

See also:
See also needed

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

Posted on October 17, 2008 - 11:25
Kronzky
By measuring the distance between the camera and the player one can determine whether 1st-person or 3rd-person view is being used:
if ((positionCameraToWorld [0,0,0] distance player)>2) then {hint "3rd person"} else {hint "1st person"}

Bottom Section