daireb
|
  |
| Joined: 16 Nov 2012 |
| Total Posts: 726 |
|
|
| 07 Feb 2015 04:27 AM |
How can I extract a rotation from a CFrame? I don't want anyone to do it for me, just point me towards some resources that can help me do this. Only way I can think of right now is string:sub(), idc if it's rotation matrix, degrees or radians, but I need this rly bad.
EG
function extractRot(CFrame) --Code goes here end
myCFrame = CFrame.new(Vector3.new(0,10,0))*CFrame.Angles(0,math.pi,0)
print(extractRot(CFrame))
> 0, 3.14159..., 0
or
> 0, 180, 0
etc. |
|
|
| Report Abuse |
|
|
| 07 Feb 2015 04:38 AM |
function extractRot(CFrame) return (CFrame - CFrame.p) end
~The herp lerped a derp~ |
|
|
| Report Abuse |
|
daireb
|
  |
| Joined: 16 Nov 2012 |
| Total Posts: 726 |
|
|
| 07 Feb 2015 04:46 AM |
Is that literally it? Wow... |
|
|
| Report Abuse |
|