Matrix

Matrix ๊ฐ์ฒด์˜ ์œ„์น˜ ํšŒ์ „ ๊ฐ’์„ ์–ป๊ฑฐ๋‚˜ ๋ณ€๊ฒฝ ํ•  ์ˆ˜ ์žˆ์–ด์š”.

์†์„ฑ

Location

Matrix์˜ ์œ„์น˜ ๊ฐ’

-- ์ƒ˜ํ”Œ --

local Cube = Workspace.Cube

local CubeTransform = Cube.Transform
print(CubeTransform.Location)

wait(2)
CubeTransform.Location = Vector.new(300, 0, 100)
Cube.Transform = CubeTransform

Rotation

Matrix์˜ ํšŒ์ „ ๊ฐ’

-- ์ƒ˜ํ”Œ --

local Cube = Workspace.Cube

local CubeTransform = Cube.Transform
print(CubeTransform.Rotation)

wait(2)
CubeTransform.Rotation = Vector.new(90, 45, 10)
Cube.Transform = CubeTransform

ScaleXYZ

Matrix์˜ ํฌ๊ธฐ ๊ฐ’

-- ์ƒ˜ํ”Œ --

local Cube = Workspace.Cube

local CubeTransform = Cube.Transform
print(CubeTransform.ScaleXYZ) --ํ•ด๋‹น ์˜ค๋ธŒ์ ํŠธ์˜ ํฌ๊ธฐ๋ฅผ 100์œผ๋กœ ๋‚˜๋ˆ ์„œ Vector๋กœ ๋ฐ˜ํ™˜ํ•ด์š”.(์˜ˆ๋ฅผ ๋“ค์–ด x๊ฐ’์ด 100์ด๋ฉด 1๋กœ ๋ฐ˜ํ•œ๋ผ์š”.)

wait(2)
CubeTransform.ScaleXYZ = Vector.new(5, 5, 5)
Cube.Transform = CubeTransform

์ƒ์„ฑ์ž

Matrix new()

Matrix ๋ฅผ ์ƒ์„ฑํ•ด์š”.

ํ•จ์ˆ˜

void AddLocation(number x, number y, number z)

์ฃผ์–ด์ง„ ๊ฐ’์œผ๋กœ ๊ธฐ์กด ์œ„์น˜์— +๋กœ ๊ณ„์‚ฐํ•ด์„œ ์œ„์น˜๋ฅผ ์„ค์ •ํ•ด์š”. (๋”ํ•˜๊ธฐ ํ•  X ๊ฐ’, ๋”ํ•˜๊ธฐ ํ•  Y ๊ฐ’, ๋”ํ•˜๊ธฐ ํ•  Z ๊ฐ’)

-- ์ƒ˜ํ”Œ --

local cube = Workspace.Cube
local cubeTransform = cube.Transform

print(cubeTransform.Location)

cubeTransform:AddLocation(200, 0, 0)
print(cubeTransform.Location)
cube.Transform = cubeTransform

void AddLocation(Vector Location)

์ฃผ์–ด์ง„ Vector๋กœ ๊ธฐ์กด ์œ„์น˜์— +๋กœ ๊ณ„์‚ฐํ•ด์„œ ์œ„์น˜๋ฅผ ์„ค์ •ํ•ด์š”. (๋”ํ•˜๊ธฐ ํ•  Vector ๊ฐ’)

-- ์ƒ˜ํ”Œ --

local cube = Workspace.Cube
local cubeTransform = cube.Transform

cubeTransform:AddLocation(Vector.new(0, 100, 0))
cube.Transform = cubeTransform

void AddRotation(Vector rotation)

์ฃผ์–ด์ง„ ๊ฐ’์œผ๋กœ ๊ธฐ์กด ๊ฐ๋„์— +๋กœ ๊ณ„์‚ฐํ•ด์„œ ๊ฐ๋„๋ฅผ ์„ค์ •ํ•ด์š”. (๋”ํ•˜๊ธฐ Vector ๊ฐ’)

-- ์ƒ˜ํ”Œ --

local cube = Workspace.Cube
local cubeTransform = cube.Transform

cubeTransform:AddRotation(Vector.new(0, 100, 0))
cube.Transform = cubeTransform

void AddRotation(number x, number y, number z)

์ฃผ์–ด์ง„ ๊ฐ’์œผ๋กœ ๊ธฐ์กด ๊ฐ๋„์— +๋กœ ๊ณ„์‚ฐํ•ด์„œ ๊ฐ๋„๋ฅผ ์„ค์ •ํ•ด์š”. (๋”ํ•˜๊ธฐ ํ•  X ๊ฐ’, ๋”ํ•˜๊ธฐ ํ•  Y ๊ฐ’, ๋”ํ•˜๊ธฐ ํ•  Z ๊ฐ’)

-- ์ƒ˜ํ”Œ --

local cube = Workspace.Cube
local cubeTransform = cube.Transform

print(cubeTransform.Rotation)

cubeTransform:AddRotation(50, 0, 0)
print(cubeTransform.Rotation)
cube.Transform = cubeTransform

Vector GetForward()

๊ฐ์ฒด๊ฐ€ ๋ฐ”๋ผ๋ณด๊ณ  ์žˆ๋Š” ๋ฐฉํ–ฅ Vector์„ ์–ป์„ ์ˆ˜ ์žˆ์–ด์š”.

-- ์ƒ˜ํ”Œ --

local cubeTransform = Workspace.Cube.Transform
print(cubeTransform:GetForward())

Vector GetRight()

๊ฐ์ฒด๊ฐ€ ๋ฐ”๋ผ๋ณด๊ณ  ์žˆ๋Š” ๋ฐฉํ–ฅ์˜ ์˜ค๋ฅธ์ชฝ ๋ฐฉํ–ฅ Vector๋ฅผ ์–ป์„ ์ˆ˜ ์žˆ์–ด์š”.

-- ์ƒ˜ํ”Œ --

local cubeTransform = Workspace.Cube.Transform
print(cubeTransform:GetRight())

Vector GetTop()

๊ฐ์ฒด์˜ ์œ„์ธก ๋ฐฉํ–ฅ Vector๋ฅผ ์–ป์„ ์ˆ˜ ์žˆ์–ด์š”.

-- ์ƒ˜ํ”Œ --

local cubeTransform = Workspace.Cube.Transform
print(cubeTransform:GetTop())

void LookAt(Vector TargetPostion, Vector UpVector)

ํŠน์ • ์œ„์น˜๋ฅผ ๋ฐ”๋ผ๋ณด๊ฒŒ ๋ณ€๊ฒฝํ•ด์š”.

-- ์ƒ˜ํ”Œ --

local transform = character.Transform
transform:LookAt(Workspace.Cube1.Location, Vector.new(0, 0, 150))
character.Transform = transform

Last updated