worldToModel: Difference between revisions

From Bohemia Interactive Community
mNo edit summary
mNo edit summary
 
Line 24: Line 24:
|p1= model: [[Object]]
|p1= model: [[Object]]


|p2= position: [[Array]] format [[Position#PositionAGL|PositionAGL]] or [[Position#Introduction|Position2D]] - world position
|p2= position: [[Position#PositionAGL|PositionAGL]] or [[Position#Introduction|Position2D]] - world position


|r1= [[Position#PositionRelative|PositionRelative]] - position relative to model
|r1= [[Position#PositionRelative|PositionRelative]] - position relative to model

Latest revision as of 07:45, 2 January 2026

Hover & click on the images for description

Description

Description:
Converts position from world space to object model space.
For scaled objects, the relative position will be divided by the object scale.
Groups:
Positions

Syntax

Syntax:
model worldToModel position
Parameters:
model: Object
position: PositionAGL or Position2D - world position
Return Value:
PositionRelative - position relative to model

Examples

Example 1:
_relPos = myObject worldToModel [0,0,0];
Example 2:
_relPos = player worldToModel ASLToAGL getPosASL car;
Example 3:
_relPos = car worldToModel [12000,5000];

Additional Information

See also:
worldToModelVisual vectorWorldToModel modelToWorld

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note