Avorable
|
  |
| Joined: 05 Jan 2014 |
| Total Posts: 847 |
|
|
| 06 Feb 2014 07:02 PM |
I'm trying to update an old code I have.
When I wrote the code, I had no idea how to use CFrames so the code looks very weird.
1) How many Radians is Pi? 2) Is CFrame.new(0,0,0) the same as CFrame.new(Vector3.new(0,0,0))? |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 07:02 PM |
| 2) I dont think CFrame.new(Vector3.new(0,0,0)) works. |
|
|
| Report Abuse |
|
|
Avorable
|
  |
| Joined: 05 Jan 2014 |
| Total Posts: 847 |
|
|
| 06 Feb 2014 07:04 PM |
>>DiamondBladee Thanks, but It was in the code and the code was working correctly. I guess if there's no real trick there, it's probably the same thing? |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 07:05 PM |
| 1) There are 2pi radians in a circle. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 06 Feb 2014 07:06 PM |
"1) How many Radians is Pi?" You mean degrees? 180
"2) Is CFrame.new(0,0,0) the same as CFrame.new(Vector3.new(0,0,0))?" Yesish, but use the first one, more efficient. |
|
|
| Report Abuse |
|
|
Avorable
|
  |
| Joined: 05 Jan 2014 |
| Total Posts: 847 |
|
|
| 06 Feb 2014 07:08 PM |
Thanks.
And I have to go by radians because that's what CFrames use for Angles. |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 07:14 PM |
You don't HAVE to go by radians...
CFrame.new(0, 0 , 0) * CFrame.Angles(math.rad(-90), 0, 0)
Perfect 90 degree turn. |
|
|
| Report Abuse |
|
|
Avorable
|
  |
| Joined: 05 Jan 2014 |
| Total Posts: 847 |
|
|
| 06 Feb 2014 07:34 PM |
the rad in math.rad stands for radian that's what I was talking about |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 06 Feb 2014 07:41 PM |
"You don't HAVE to go by radians...
CFrame.new(0, 0 , 0) * CFrame.Angles(math.rad(-90), 0, 0)"
Wow, you just said that -.- That is converting it to radians, meaning you HAVE to go by radians... |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 07:43 PM |
| Pi is just 180 degrees. It is 3.14 radians. We are doing the unit circle. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 06 Feb 2014 08:02 PM |
| @cntkillme Can;t remember where I learned it, but it works perfectly fine when I am CFraming the camera. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 06 Feb 2014 08:07 PM |
| because math.rad converts it into radians, meaning you are still essentially using radians, just inputting degrees in a function and returning deg*pi/180 |
|
|
| Report Abuse |
|
|