Miro034
|
  |
| Joined: 07 Oct 2009 |
| Total Posts: 6568 |
|
|
| 07 Mar 2012 04:49 PM |
Can you please analyse this line for me because I need to master it. Just try explaining the 3 dimensional thingy x,y and z such as a showing which one part moves. I'm just trying to make my own animations by using my imagination.
weld33.C1 = CFrame.new(x, y, z) * CFrame.fromEulerAnglesXYZ(math.rad(x), math.rad(y), z) |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 07 Mar 2012 04:56 PM |
CFrame.new(x,y,z) --x, y, z, are positions like Vector3's first 3 parameters.
CFrame.new(x,y,z)*CFrame.Angles(x,y,z) --Is a rotation matrix, x, y, z, being angles
math.rad(#) --Converting # into radians |
|
|
| Report Abuse |
|
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 07 Mar 2012 04:56 PM |
*analyze
CFrame is actually a rotation matrix, which is difficult to understand without a proper demonstration. What this line does is apply positioning and rotation to a CFrame.
CFrame.new(x, y, z) -- This bit simply creates a new CFrame with the Position of (x,y,z). * CFrame.Angles(x, y, z) -- This applies rotation to the CFrame along the corresponding axis, in radian. math.rad(d) converts degrees d into radians.
To modify a part, simple do this:
part.CFrame = (part.CFrame + Vector3.new(xChange, yChange, zChange)) * CFrame.Angles(math.rad(xRot), math.rad(yRot), math.rad(zRot)) |
|
|
| Report Abuse |
|
|
Miro034
|
  |
| Joined: 07 Oct 2009 |
| Total Posts: 6568 |
|
|
| 07 Mar 2012 04:59 PM |
| I think I should stop speaking the British Dialect(Common English)...Thanks btw |
|
|
| Report Abuse |
|
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 07 Mar 2012 05:07 PM |
Don't stop speaking it, just understand that type doesn't have an accent, and Americans spell words differently. :P
YW, btw. |
|
|
| Report Abuse |
|
|
Miro034
|
  |
| Joined: 07 Oct 2009 |
| Total Posts: 6568 |
|
| |
|