positionCameraToWorld: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(add. classification)
m (modelToWorld vs. positionCameraToWorld)
Line 35: Line 35:
</dd>
</dd>


The camera coordinate system is different from the model coordinate system: when [[modelToWorld]] uses [x, z, y] then positionCameraToWorld uses [x, y, z]. So for a steady camera the following is true:
positionCameraToWorld [5,10,15] == _camera modelToWorld [5,15,10];
--[[User:Worldeater|Worldeater]] 22:45, 17 October 2010 (CEST)
<!-- Note Section END -->
<!-- Note Section END -->
</dl>
</dl>

Revision as of 22:45, 17 October 2010

-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:
Array = positionCameraToWorld position
Parameters:
position: Array - format 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"}
The camera coordinate system is different from the model coordinate system: when modelToWorld uses [x, z, y] then positionCameraToWorld uses [x, y, z]. So for a steady camera the following is true: positionCameraToWorld [5,10,15] == _camera modelToWorld [5,15,10]; --Worldeater 22:45, 17 October 2010 (CEST)

Bottom Section