# DModelPanel:SetCamPos

- **Ortam:** İstemci
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/DModelPanel:SetCamPos
- **Çeviri tarihi:** 2025-09-08

```lua
DModelPanel:SetCamPos( Vector pos )
```

## Açıklama

Kameranın pozisyonunu ayarlar.

## Argümanlar

1. [Vector](https://gmod.tr/wiki/Vector) **pos**: Kameranın ayarlanacağı pozisyon.

### Örnek

Gman kravatını düzeltirken yüzüne odaklanmış bir model paneli oluşturur.

```lua
BGPanel = vgui.Create("DPanel")
BGPanel:SetPos(20, 20)
BGPanel:SetSize(200, 200)
BGPanel:SetBackgroundColor(Color(0, 0, 0, 255))

local mdl = vgui.Create("DModelPanel", BGPanel)
mdl:SetSize(BGPanel:GetSize())
mdl:SetModel("models/player/gman_high.mdl")

function mdl:LayoutEntity(ent)
	ent:SetSequence(ent:LookupSequence("menu_gman"))
	mdl:RunAnimation()
	return
end

local eyepos = mdl.Entity:GetBonePosition(mdl.Entity:LookupBone("ValveBiped.Bip01_Head1"))

eyepos:Add(Vector(0, 0, 2))	-- Hafifçe yukarı taşı

mdl:SetLookAt(eyepos)

mdl:SetCamPos(eyepos-Vector(-12, 0, 0))	-- Kamerayı gözlerin önüne taşı

mdl.Entity:SetEyeTarget(eyepos-Vector(-12, 0, 0))
```

**Çıktı:** ![](https://gmod.tr/api/uploads/wiki/c6641c51b1c2257b403a.jpg)

### Örnek

Modelin dışına çıkmaması için bir model panelinin kamera pozisyonunu ayarlar.

```lua
local mdlpnl = vgui.Create( "DModelPanel" )

local mn, mx = mdlpnl.Entity:GetRenderBounds()
local size = 0
size = math.max( size, math.abs(mn.x) + math.abs(mx.x) )
size = math.max( size, math.abs(mn.y) + math.abs(mx.y) )
size = math.max( size, math.abs(mn.z) + math.abs(mx.z) )

mdlpnl:SetFOV( 45 )
mdlpnl:SetCamPos( Vector( size, size, size ) )
mdlpnl:SetLookAt( (mn + mx) * 0.5 )
```

- [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/DModelPanel:SetCamPos
