# render.ComputePixelDiameterOfSphere

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

```lua
number render.ComputePixelDiameterOfSphere( Vector point, number radius )
```

## Açıklama

3 boyutlu bir kürenin 2 boyutlu bir ekrandaki çapını piksel cinsinden hesaplar.

> **NOT:** Bu, 3 boyutlu bir renderlama bağlamı gerektiren bir renderlama fonksiyonudur.
>
> Bu, yalnızca [3d Renderlama Kancaları](https://gmod.tr/wiki/3D_Rendering_Hooks)'nda (Hooks) çalışacağı anlamına gelir.

## Argümanlar

1. [Vector](https://gmod.tr/wiki/Vector) **point**: Kürenin 3D uzaydaki konumu.
2. [number](https://gmod.tr/wiki/number) **radius**: Kürenin 3D uzaydaki yarıçapı.

## Döndürülenler

1. [number](https://gmod.tr/wiki/number): Kürenin 2D ekran uzayındaki piksel cinsinden çapı.

### Örnek

```lua
hook.Add( "HUDPaint", "HUDPaint_PixelDiameterOfSphereExample", function()

	local point = Vector( 0, 0, 0 )

	cam.Start3D()
	local diameter = render.ComputePixelDiameterOfSphere( point, 10 )
	cam.End3D()

	local pos2D = point:ToScreen()
	surface.DrawCircle( pos2D.x, pos2D.y, diameter / 2, Color( 255, 120, 0 ) )

end )
```

- [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/render.ComputePixelDiameterOfSphere
