---
name: "modelToWorld"
type: command
status: ok
groups: ["Positions"]
arma3_since: "0.50"
locality: {"argument": "global", "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/modelToWorld
revid: 377424
updated: 2026-01-02T06:45:36Z
---

# modelToWorld

*Command · Positions · Arma 3 v0.50 · introduced in Armed Assault v1.00*

Locality: arguments **global**

## Description

Translates relative position from object model space to world space in [PositionAGL](../topics/Position.md#positionagl) format.

This command will take into account [vectorUp](../commands/vectorUp.md) of the object when calculating relative coordinates.
For the [PositionASL](../topics/Position.md#positionasl) version of this command, see [modelToWorldWorld](../commands/modelToWorldWorld.md).

> [!IMPORTANT]
> For [scaled objects](../commands/setObjectScale.md), the relative position will first be [multiplied](../commands/vectorMultiply.md) by the object scale.
>
> For example, if the object scale is 2, `_obj modelToWorld [0,1,0]` will be offset **2 meters** from the model center (`[0,0,0]`).

## Syntax

```sqf
model modelToWorld position
```

**Parameters:**

- `model`: [Object](../topics/Object.md)
- `position`: [PositionRelative](../topics/Position.md#positionrelative) - [x,y,z] offset relative to the model centre

**Returns:** [PositionAGL](../topics/Position.md#positionagl) - translated world position

## Examples

### Example 1

```sqf
_aboveAndBehindPlayer = player modelToWorld [0,-1,3];
```

## See also

[vectorModelToWorld](../commands/vectorModelToWorld.md) · [modelToWorldVisual](../commands/modelToWorldVisual.md) · [worldToModel](../commands/worldToModel.md) · [modelToWorldWorld](../commands/modelToWorldWorld.md) · [modelToWorldVisualWorld](../commands/modelToWorldVisualWorld.md) · [selectionPosition](../commands/selectionPosition.md)

## Community notes

**Dr_Eyeball** — 2007-02-18

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:

```sqf
_offset = [_x,_y,_z];
_worldPos = _relObj modelToWorld _offset;
_obj setPos _worldPos;
```

---

**ManDay** — 2007-07-24

The object model space has got its Z-Axis along the object's [vectorUp](../commands/vectorUp.md),
its Y-Axis along the object's [vectorDir](../commands/vectorDir.md),
while its X-Axis goes along [vectorDir x VectorUp](https://en.wikipedia.org/wiki/Cross_product) (meaning as the X-Axis in a [right-handed cartesian coordiante system](https://en.wikipedia.org/wiki/Cartesian_coordinate_system#In_three_dimensions)).

---

**Dr_Eyeball** — 2008-05-08

If your object requires a new direction, ensure you call [setDir](../commands/setDir.md) *prior* to [setPosATL](../commands/setPosATL.md) when using [modelToWorld](../commands/modelToWorld.md).
Calling setDir afterwards will skew its position otherwise.

```sqf
_ladder setDir _angle;
_ladder setPosATL (_building modelToWorld [_x, _y, _z]);
```

---

**Hduregger** — 2011-02-06

The z height returned changes dynamically with the height of waves beneath the object, if the object is located over sea.
The z height returned by [getPosATL](../commands/getPosATL.md) and [getPosASL](../commands/getPosASL.md) does not change like this.
This was tested by continuously retrieving the position of a static object, like the cross in the empty/corpses category, placed over sea or land.
[modelToWorld](../commands/modelToWorld.md) behaves similar to [getPos](../commands/getPos.md) but it does not give the same result, therefore

```sqf
_obj modelToWorld [0.0, 0.0, 0.0]
```

is **not** the same as 

```sqf
getPos _obj;
```

.

<sub>Source: [BI Community Wiki — modelToWorld](https://community.bistudio.com/wiki/modelToWorld) (revision 377424).</sub>
