Question on EgoMooses Placing System

function Placement:CalcCanvas()
	local canvasSize = self.CanvasPart.Size

	-- want to create CFrame such that cf.lookVector == self.CanvasPart.CFrame.upVector
	-- do this by using object space and build the CFrame
	local back = Vector3.new(0, -1, 0)
	local top = Vector3.new(0, 0, -1)
	local right = Vector3.new(-1, 0, 0)

	-- convert to world space
	local cf = self.CanvasPart.CFrame * CFrame.fromMatrix(-back*canvasSize/2, right, top, back)
	-- use object space vectors to find the width and height
	local size = Vector2.new((canvasSize * right).magnitude, (canvasSize * top).magnitude)

	return cf, size
end

why is

local back = Vector3.new(0, -1, 0)
when back is supposed to be (0,0,1)
local top = Vector3.new(0, 0, -1)
when top is supposed to be (0,1,0)
local right = Vector3.new(-1, 0, 0)
when right is supposed to be (1,0,0)

You could’ve replied to the original post, or personally DM EgoMoose for this though


As stated above the variables, these are used to form the rotation matrix of a CFrame to orient the part in such a way that makes the part’s front surface face the upvector of CanvasPart’s CFrame, which by looking at the variables used, makes it face the global upvector

I used the same code, but changed it a bit of course, and the part was oriented in a way that makes its front surface face upwards:

Printing the Right, Up and LookVectors of course returned the variables back:

is there a article about matrixes?