May someone explain the math behind it and how it works. I've been told it's been used for Cframe Interpolation.
Please Explain (Constructor) CFrame.new(x, y, z, R00, R01, R02, R10, R11, R12, R20, R21, R22)?
1 answer
As mentioned before, CFrames are matrices.
In particular, they are 4x4 matrices. This is so that you have a 3x3 matrix, which represents rotations in 3D, plus a fourth fixed dimension. They are arranged like this:
[ x f u r ]
[ y w p g ]
[ z d p t ]
[ 1 0 0 0 ]
-- [x y z]: Position
-- [f w d]: Forward direction
-- [u p p]: Up direction
-- [r g t]: Right direction
That is, there are 12 numbers that define a CFrame.
CFrame.new(x, y, z, R00, R01, R02, R10, R11, R12, R20, R21, R22) corresponds to filling the entries of that matrix in the order (x, y, z, f, w, d, u, p, p, r, g, t)[^1].
[^1]: I think. Someone might correct me on the order. Again, you shouldn't be using this constructor except to replicate the results of tostring to :components()
The only time you need this constructor is to restore arbitrary CFrames that were saved -- since you need all 12 numbers to uniquely represent it, this will be your only choice if you, e.g., wanted to store CFrames in a string.
Normally, you don't want to do anything as silly as that, and the other constructors CFrame.new(x, y, z) and CFrame.Angles(x, y, z) and CFrame.new(from, to) are far more than enough.
Takeway: This exposes the way CFrames are stored in a fairly useless way. You shouldn't use it unless you are using it in conjunction with :components()
2 comments
I am wondering though... -? what is the best way to try Cframe Interpolation... What do i need to know especially for math.
The math is quaternions, which I haven't ever bothered to research. I would highly suggest just using someone else's implementation instead of spending the time to arrive at exactly the same code.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
You don't need it.
He's right you know
Good question, but you will not understand the real answer (and if you think you do, you don't). Be prepared for a boiled down answer that isn't necessarily wrong, but just dumbed down so you can actually understand SOMETHING.