> For the complete documentation index, see [llms.txt](https://docs.overdare.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.overdare.com/korean/manual/studio-manual/get-started/coordinate-system.md).

# 좌표계

## 개요

좌표계는 3D 공간에서 오브젝트의 위치, 크기, 회전을 표현하는 3D 좌표계와 2D 공간에서 GUI 요소의 Scale과 Offset을 정의하는 2D 좌표계(UDim2)로 구성됩니다

## 3D 좌표계

OVERDARE Studio에서 3D 공간의 좌표계는 오른손 좌표계를 사용하며, 위치와 크기의 기본 단위는 **센티미터(cm)**&#xC785;니다.

<figure><img src="/files/uLJtPBc2UrZlaYLHM0N3" alt=""><figcaption></figcaption></figure>

객체의 **위치(Position)**&#xB098; **회전값(Orientation)**&#xC740; **Vector3**를 사용해 개별적으로도 설정할 수 있지만, **CFrame** 데이터 타입을 이용하면 한 번에 설정할 수도 있습니다.

```lua
-- Position
Part.Position = Vector3.new(0, 50, -300)

-- Orientation
Part.Orientation = Vector3.new(0, 0, 30)

-- CFrame
local targetPosition = Vector3.new(0, 30, 0)
local upVector = Vector3.new(0, 1, 0)
Part.CFrame = CFrame.lookAt(Part.Position, targetPosition, upVector)
```

CFrame은 **Coordinate Frame**의 약자로, 객체의 위치(Position)와 회전(Orientation) 정보를 모두 포함하는 데이터 타입입니다.

자세히 알아보기

{% content-ref url="/pages/ev5gqi59G865SHR13ed1" %}
[CFrame](/korean/development/api-reference/datatype/cframe.md)
{% endcontent-ref %}

## 2D 좌표계

OVERDARE Studio에서 2D 공간은 UDim2 형식을 사용하며, UDim2에서 Scale은 부모 오브젝트의 크기에 대한 비율(%)을, Offset은 픽셀 단위의 위치나 크기를 의미합니다.

<figure><img src="/files/xhjNQJGNowCV9AoAVGaP" alt=""><figcaption></figcaption></figure>

```lua
local TextLabel = script.Parent

TextLabel.AnchorPoint = Vector2.new(0.5, 0.5)
TextLabel.Position = UDim2.new(0.5, 0, 0.5, 0)
TextLabel.Size = UDim2.new(0.5, 0, 0, 200)

local TextPos = TextLabel.Position
print(TextPos.X.Scale, TextPos.X.Offset, TextPos.Y.Scale, TextPos.Y.Offset)
```
