worldToModel: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\| *((\[\[[a-zA-Z0-9_ |()]+\]\],? ?)+) * \}\}" to "|seealso= $1 }}") |
(Example 2 now uses PositionAGL instead of PositionAGLS) |
||
Line 1: | Line 1: | ||
{{RV|type=command | {{RV|type=command | ||
| arma1 | |game1= arma1 | ||
|1.00 | |version1= 1.00 | ||
|gr1= Positions | |gr1= Positions | ||
| Converts position from world space to object model space. | |descr= Converts position from world space to object model space. | ||
| model [[worldToModel]] position | |s1= model [[worldToModel]] position | ||
|p1= model: [[Object]] | |p1= model: [[Object]] | ||
|p2= position: [[Array]] - | |p2= position: [[Array]] - World position, format [[PositionAGL]] or [[Position2D]] | ||
| [[Array]] - | |r1= [[Array]] - Position relative to model, format [[PositionRelative]] | ||
|x1= <code>_relPos = myObject [[worldToModel]] [0,0,0];</code> | |x1= <code>_relPos = myObject [[worldToModel]] [0,0,0];</code> | ||
|x2= <code>_relPos = [[player]] [[worldToModel]] [[ | |x2= <code>_relPos = [[player]] [[worldToModel]] [[ASLToAGL]] [[getPosASL]] car;</code> | ||
|x3= <code>_relPos = car [[worldToModel]] [12000,5000]; </code> | |x3= <code>_relPos = car [[worldToModel]] [12000,5000]; </code> | ||
|seealso= [[worldToModelVisual]] | |seealso= [[worldToModelVisual]] [[vectorWorldToModel]] [[modelToWorld]] | ||
}} | }} | ||
Revision as of 09:01, 27 February 2021
Description
- Description:
- Converts position from world space to object model space.
- Groups:
- Positions
Syntax
- Syntax:
- model worldToModel position
- Parameters:
- model: Object
- position: Array - World position, format PositionAGL or Position2D
- Return Value:
- Array - Position relative to model, format PositionRelative
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 or on the Forums.
Only post proven facts here! Add Note