CFrame rotation matrix indices are transposed

Issue Description
The CFrame rotation matrix currently shows the indices as follows, which is incorrect.


The indices should instead be transposed.

This can be verified by running the following code, which uses the corrected indices to define up/right/look vectors equal to the canonical CFrame.UpVector/CFrame.RightVector/CFrame.LookVector.


local cf = CFrame.Angles(math.random(), math.random(), math.random())
local _, _, _, r00, r01, r02, r10, r11, r12, r20, r21, r22 = cf:GetComponents()

local upVector = Vector3.new(r01, r11, r21)
local lookVector = -Vector3.new(r02, r12, r22)
local rightVector = Vector3.new(r00, r10, r20)

print(upVector:FuzzyEq(cf.UpVector))
print(rightVector:FuzzyEq(cf.RightVector))
print(lookVector:FuzzyEq(cf.LookVector))

This prints

> true
> true
> true

to indicate that they are equal.

Issue Area: DevHub Content
Page URL: CFrame

5 Likes

I’ll file a ticket for this right away, thanks!

2 Likes

Update on this, the change was approved and is in the pipeline. Should be visible within a week, maybe not because of the holiday. Thanks again for the report :slight_smile:

1 Like