Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I transform a unit vector to a CFrame? E.g. CFrame.new(rightVector, upVector, backVector)

Asked by 5 years ago

I was wondering how to transform a rightVector, upVector, and a backVector to a CFrame. You Know when you do CFrame:components(), you get R00, R10, R20, R01, R11, R21, R02, R12, and R22. And you can make them vectors. For example, rightVector, Vector3.new(R00, R10, R20). Anyways, is it possible?

0
CFrame:components() returns the individual components that make up the cframe matrix. Similarly, there is a constructor for CFrame that takes in the individual components of a matrix and returns it. Just use that constructor. RayCurse 1518 — 5y
0
You can check the wiki for CFrame to see all the constructors, but if you have the vectors, don't you already have the CFrame you can just copy? But yes, that info you have is enough to calculate a CFrame, given you know what position you want. gullet 471 — 5y
0
Yeah, but I'm just asking is there a way to do it other than writing down CFrame.new(1, 2, 3, 4, 5, 6, 7, 8, 9)? User#24541 10 — 5y
0
True, but that's what I'm asking. User#24541 10 — 5y
View all comments (2 more)
0
Is there any reason you don't want to use the function that's meant for this use case? It's like asking how to write text to the output without using print() RayCurse 1518 — 5y
0
Also by asking this question, I'm also asking how they turn the matrix to just three numbers. User#24541 10 — 5y

Answer this question