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
 

Re: CFrame Rotation

Previous Thread :: Next Thread 
Octopus is not online. Octopus
Joined: 26 Feb 2008
Total Posts: 460
23 Nov 2012 12:01 PM
I am trying to rotate a Cframe over an interval. I know how to translate (slide) it, but I can't rotate it. I am using the raw Cframe, with all the numbers. I don't have the specific .Angles. I am trying to write a general equation for it so I don't have a custom solution for one block
Report Abuse
rayoma is not online. rayoma
Joined: 13 Nov 2009
Total Posts: 1911
23 Nov 2012 12:03 PM
It would be a lot easier to just do

CFrame.new(0,0,0)*CFrame.Angles(0,0,0)

instead of having to do all that math yourself which would be ten times more complicated.
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
23 Nov 2012 12:04 PM
Unless you want to back-trace the math on this wiki page,

http://wiki.roblox.com/index.php/CFrame#Rotation_Matrix

then I suggest using the general format of CFrame.new() * CFrame.Angles(). If you want to keep the current CFrame then you can do:

CFrame.new(Part.Position) * CFrame.Angles(0,0,0)
or to add to the current angles
Part.CFrame * CFrame.Angles(0,0,0)
Report Abuse
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
23 Nov 2012 12:07 PM
Using rotation matrices is hipster, duh

¬ SHG Scripter Tier-2 ♣ LuaLearners Elite
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
23 Nov 2012 12:08 PM
"Using rotation matrices is hipster, duh"

That's definitely fine if you want to do that. It is actually more efficient than making the matrix create the values. You can do it here, via the math I wrote out for the function: http://wiki.roblox.com/index.php/User:MrNicNac/RotationMatrixMath
Report Abuse
Octopus is not online. Octopus
Joined: 26 Feb 2008
Total Posts: 460
23 Nov 2012 12:09 PM
Those would give me specific answers. I am looking for a more generalized one that would save me time. The real struggle is the fact that the only values you can actually pull out are
.p
.x
.y
.z
.lookVector


P.S. I read the wiki before I ask for help.
Report Abuse
rayoma is not online. rayoma
Joined: 13 Nov 2009
Total Posts: 1911
23 Nov 2012 12:11 PM
So what exactly are you looking for?
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
23 Nov 2012 12:11 PM
You're original question still makes little sense. Are you trying to pull out the angles via an equation?
Report Abuse
Octopus is not online. Octopus
Joined: 26 Feb 2008
Total Posts: 460
23 Nov 2012 12:19 PM
Typing on iPad is annoying, so ill try to do this best as possible

for v = 1, interval do
weld.C1 = weld.C1+Vector3.new((weld1.x-weld2.x)/interval, (weld1.y-wled2.y)/interval, (weld1.z-weld2.z)/interval)
weld.C1 = weld.C1*CFrame.Angles(rx,ry,rz)
wait()
end

--I have the Cframe in form of (x, y, z, R00, R01, R02, R10, R11, R12, R20, R21, R22)
-- I am fine with sliding it, but rotating it over an interval is annoying if I don't have the .Angles I can read off of the script, and even then I have to use weld1.x instead of weld1.rx because its dumb
Report Abuse
Octopus is not online. Octopus
Joined: 26 Feb 2008
Total Posts: 460
23 Nov 2012 12:37 PM
If roblox would allow it to read CFrame.rx then my problem would be solved
Report Abuse
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
23 Nov 2012 12:39 PM
toEulerAnglesXYZ?

CFrame:toEulerAnglesXYZ() returns "best guess" angles that could be used to generate CFrame. See Euler angles.

It pulls the rotation angles from a CFrame.

¬ SHG Scripter Tier-2 ♣ LuaLearners Elite
Report Abuse
BJCarpenter is not online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
23 Nov 2012 12:48 PM
Yeah, I wanted to use radians instead of angles to save the computer some math, and maybe give me some "more round" numbers to deal with and try to make easily referenced Cells on a Geodesic Globe.
Like turn the radians with math.floor into string.names like "1,3,6"
,

But I still ended-up using math.pi, which is a function, and multyplying it, so realy saved no math, and got nowhere.
Report Abuse
Octopus is not online. Octopus
Joined: 26 Feb 2008
Total Posts: 460
23 Nov 2012 12:53 PM
Ah that's it doombringer, now I am assuming the best way to pull out a specific rotation would be to insert the euleranglesxyz into a table and pull the one out that I want. That is awesome, thank you
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