Why does CFrame.new have 12 parameters?

Quoted from ROBLOX Developer Hub:
“Creates a CFrame from position (x, y, z) with an orientation specified by the rotation matrix [[R00 R01 R02] [R10 R11 R12] [R20 R21 R22]]”

So I get the first x,y,z, that’s just the vector3 position, but the other 9 I don’t understand. I’m fairly sure R is just an abbreviation for Rotation, but I can’t be sure.

Anyway, how can rotation have 9 values? Can someone explain what this matrix’s contents actually mean?

1 Like

" CFrame stores 3D rotation data in a 3-by-3 rotation matrix ."

You can technically ignore the las three as it is just the forward vector which is calculated by the other previous six values.

To understand I recommend making an attachment.

Then set view attachments to true.

The position of the attachment would be the first three

The Orange Arrow would be the Next three and the Yellow arrow would represent the next three numbers after that

Note the Orange arrow and Yellow arrows represent unit vectors. they are of length 1

Thats how I figured it out anyways.


Also CFrame.new is quite heavily loaded with different ways you can use it. You can even set a quaternion rotation with 4 values.

Other 9 numbers is a UpVector,RightVector,LookVector and it looks like this:
x,y,z,uv.X,rv.X,lv.X,uv.Y,rv.Y,lv.Y,-uv.Z,-rv.Z,-lv.Z

2 Likes