# LocalToWorld

- **Ortam:** İstemci, Sunucu
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/Global.LocalToWorld
- **Çeviri tarihi:** 2025-11-20

```lua
Vector, Angle LocalToWorld( Vector localPos, Angle localAng, Vector originPos, Angle originAngle )
```

## Açıklama

Bir vektörü ve açıyı yerel bir koordinat sisteminden küresel bir koordinat sistemine çevirir.

Bu fonksiyonun tersi için bkz. [WorldToLocal](https://gmod.tr/wiki/Global.WorldToLocal).

Bir entity'nin yerel uzay vektörleri/açıları ile çalışmak için bunun yerine [Entity:LocalToWorld](https://gmod.tr/wiki/Entity.LocalToWorld)/[Entity:LocalToWorldAngles](https://gmod.tr/wiki/Entity.LocalToWorldAngles) kullanmayı düşünebilirsiniz.

## Argümanlar

1. [Vector](https://gmod.tr/wiki/Vector) **localPos**: Yerel bir koordinat sisteminden bir vektör.
2. [Angle](https://gmod.tr/wiki/Angle) **localAng**: Yerel bir koordinat sisteminden bir açı. Bir açıyı çevirmeniz gerekmiyorsa sıfır açısı girin.
3. [Vector](https://gmod.tr/wiki/Vector) **originPos**: Küresel bir koordinat sisteminin orijini, dünya uzayı (worldspace) koordinatlarında.
4. [Angle](https://gmod.tr/wiki/Angle) **originAngle**: Küresel bir koordinat sisteminin açıları, bir dünya uzayı (worldspace) açısı olarak.

## Dönen Değerler

1. [Vector](https://gmod.tr/wiki/Vector): `localPos`'a karşılık gelen dünya uzayı (worldspace) vektörü.
2. [Angle](https://gmod.tr/wiki/Angle): `localAng`'a karşılık gelen dünya uzayı (worldspace) açısı.

### Örnek

Bunun dahili olarak nasıl hesaplandığını gösteren bir matris matematiği.

```lua
local localTransform = Matrix()
localTransform:SetTranslation( localPos )
localTransform:SetAngles( localAng )

local worldTransform = Matrix()
worldTransform:SetTranslation( originPos )
worldTransform:SetAngles( originAngle )

-- Transform the local coordinates using the world transform as a transformation matrix
local localToWorld = worldTransform * localTransform

print( localToWorld:GetTranslation(), localToWorld:GetAngles() )
```

- [GMod Wiki ana sayfası](https://gmod.tr/wiki)

---

[Tüm sunucular](https://gmod.tr/) · [GmodTR Launcher](https://gmod.tr/launcher) · [Rehber](https://gmod.tr/rehber) · [GMod Wiki](https://gmod.tr/wiki) · [GmodTR nedir?](https://gmod.tr/hakkinda) · [Sunucu ekle](https://gmod.tr/sunucu-ekle) · [Discord](https://discord.gg/gmodtr)

Kaynak: https://gmod.tr/wiki/Global.LocalToWorld
