generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Help needed...

Previous Thread :: Next Thread 
Miro034 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
08 Mar 2012 01:42 PM
k
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image