Why do multiplying CFrame by CFrame return relative position?

Why do a multiplying CFrame by CFrame return relative position?
Could you explain its principle?

you can think of a cframe as containing both positional and rotational data on a object (somewhat false)

Multiplying 2 cframes is pretty much just adding them so

local OriginalCFrame = Part.CFrame -- this contains rotation
local TransitionCF = CFrame.new(0,0,10)

OriginalCFrame*TransitionCF -- all this is doing is adding the positional value onto the other positional value, while maintaining rotational data

Another example say you want to reposition a object but keep its current rotation you can do

local RotationCF = Part.CFrame - Part.CFrame.p -- gets rid of position value
Part.CFrame = CFrame.new(0,10,0)*RotationCF -- resets position while adding on its original rotation value

The typical term for a cf*cf operation is converting a relative(local) position into world space

Also it doesn’t return relative position it returns world position, (if it return relative it wouldnt work)
it can return relative if you do something like this
CF:Inverse()*CF

1 Like