Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I dont understand cf:components is this the right way to think about it?

Asked by 4 years ago
cf = CFrame.new()
local x, y, z, m11, m12, m13, m21, m22, m23, m31, m32, m33 = cf:components()

local right = Vector3.new(m11, m21, m31) -- This is the same as cf.rightVector
local up = Vector3.new(m12, m22, m32) -- This is the same as cf.upVector
local back = Vector3.new(m13, m23, m33) --This is the same as -cf.lookVector

print(cf:components()) --Prints  {0 0 0} {1 0 0} {0 1 0} {0 0 1}
--Is this right?




I never understood why but

why isn't it


m11,m12,m13 = cf.rightVector m21,m22,23 = cf.upVector m31,m32,m33 = cf.lookVector

the numbers that prints

when i do

print(cf:components()) -- 0 0 0 1 0 0 0 1 0 0 0 1

they look so much like right up back {0 0 0} {1 0 0} {0 1 0} {0 0 1}

Answer this question