modelToWorld
From Bohemia Interactive Community
| Editors, please check Policy: Scripting Command Page Syntax. |
Click on the images for descriptions
Introduced in
- Game:
- Armed Assault
- Version:
- 1.00
Description
- Description:
- Converts position from object model space to world space.
Syntax
Examples
- Example 1:
_WorldPos=_object modelToWorld _ModelPos
Additional Information
- Multiplayer:
- Behaviour unknown.
- See also:
- worldToModel
Notes
Notes
Notes
- Posted on 16 Feb, 2007
- Dr_Eyeball
-
The worldPos parameter appears to be a relative offset to the position of object, so it can often simply be [0,0,0].
Example: to position an object _obj relative to the position of another object _RelObj with on offset of _Offset, try:_Offset = [_x,_y,_z]; _worldPos = _RelObj modelToWorld _Offset; _obj setPos _worldPos;
- Posted on 16 Feb, 2007
- Manny
- The object model space has got its Z-Axis along the object's vectorUp, its Y-Axis along the object's vectorDir, while its X-Axis goes along vectorDir x VectorUp (meaning as the X-Axis in a right-handed cartesian coordiante system).
- Posted on 8 May, 2008
- Dr_Eyeball
-
If your object requires a new direction, ensure you call setDir prior to setPos when using modelToWorld. Calling setDir afterwards will skew its position otherwise.
_ladder setDir _angle; _ladder setPos (_building modelToWorld [_x, _y, _z]);

