Why CFrame angles "*" instead of "+"?

Hello, everyone.
As I was learning more about cframe and rotations, I realized that with things like angles, you’d have to do something like part.CFrame = part.CFrame * CFrame.Angles(0, math.rad(45), 0)

But, can someone explain to me the logic behind using * to add angles instead of +?

Sincerely,
-coolguyweir

1 Like

:grimacing: I’m not too familiar with the internals of how CFrames work either but it has a lot to do with mutliplying matricies together, I would look here - CFrame Math Operations (roblox.com)

It’s complex in my eyes since a lot of these concepts are Linear Algebra concepts, and I haven’t really gotten to that point of exploring that subject yet.

Thanks for the link! It’s also very complicated for me too lol

1 Like

As @Jonesloto mentioned, this is a process of multiplying matrices together. Roblox provides this code to understand what’s happening when you multiply two matrices:

local function multiplyCFrame(a, b)
	local ax, ay, az, a11, a12, a13, a21, a22, a23, a31, a32, a33 = a:components()
	local bx, by, bz, b11, b12, b13, b21, b22, b23, b31, b32, b33 = b:components()
	local m11 = a11*b11+a12*b21+a13*b31
	local m12 = a11*b12+a12*b22+a13*b32
	local m13 = a11*b13+a12*b23+a13*b33
	local x = a11*bx+a12*by+a13*bz+ax
	local m21 = a21*b11+a22*b21+a23*b31
	local m22 = a21*b12+a22*b22+a23*b32
	local m23 = a21*b13+a22*b23+a23*b33
	local y = a21*bx+a22*by+a23*bz+ay
	local m31 = a31*b11+a32*b21+a33*b31
	local m32 = a31*b12+a32*b22+a33*b32
	local m33 = a31*b13+a32*b23+a33*b33
	local z = a31*bx+a32*by+a33*bz+az
	return CFrame.new(x, y, z, m11, m12, m13, m21, m22, m23, m31, m32, m33)
end

Here are some other resources:

1 Like

Wowza thanks for all that info!
But tbh I still don’t really get it xDDD
But thanks anyways!

1 Like