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 » Scripters
Home Search
 

Re: Euler Angles Extraction (Avoiding Gimbal Lock)

Previous Thread :: Next Thread 
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
24 Jun 2012 06:00 PM
So the typical matrix in ROBLOX is built like this:

m = CFrame.new(
m00, m01, m02,
m10, m11, m12,
m20, m21, m22
)

And say I wanted to get the 3-dimension rotational value from this makeup, I assume the following work and avoiding singularities at the poles.

m = --given above
local m00, m01, m02, m10, m11, m12, m20, m21, m22 = m:components()

if m10 > .998 then
x = math.atan2(m02, m22)
y = math.pi/2
z = 0
return x,y,z
elseif m10 < -.998 then
x = math.atan2(m02, m22)
y = -math.pi/2
z = 0
return x,y,z
end
x = math.atan2(-m20, m00)
y = math.atan2(-m12, m11)
z = math.asin(m10)

This is all correct, right?
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
24 Jun 2012 06:11 PM
Bump
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
24 Jun 2012 06:46 PM
[ Content Deleted ]
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
24 Jun 2012 06:48 PM
"There is no reason for you to get the angles from a CFrame."

Abuh, bu, bah!

Yes there is! I'm trying to do it for the sake of knowing how. Now does the example avoid gimbal lock?
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
24 Jun 2012 07:25 PM
[ Content Deleted ]
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
24 Jun 2012 08:57 PM
Is that not what I am doing when checking if for the 1.0 pole.
Report Abuse
lombardo2 is not online. lombardo2
Joined: 30 Nov 2008
Total Posts: 1604
24 Jun 2012 09:13 PM
yeah, but CFrame:components() returns 12 values
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
24 Jun 2012 09:15 PM
So I'll just throw some x,y,z thing in there...
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
25 Jun 2012 12:45 PM
Is there anyone who can say yes, or no?
Report Abuse
lombardo2 is not online. lombardo2
Joined: 30 Nov 2008
Total Posts: 1604
25 Jun 2012 01:34 PM
I'm not experienced with matrices and rotation... so I can't say anything
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
25 Jun 2012 02:08 PM
How helpful.
Report Abuse
Combrad is not online. Combrad
Joined: 18 Jul 2009
Total Posts: 11025
25 Jun 2012 03:26 PM
Although this of no use to you.
Thank you for explaining Gimbal lock.
Explains why my CFrame tween script failed horribly.

Fixed that now though.
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
25 Jun 2012 05:01 PM
Glad my problem was your fix...?
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
25 Jun 2012 05:33 PM
Gimbal lock is when two euler axis's meet up with each other on the same axis.
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
26 Jun 2012 06:21 AM
....

Does my little script up there create rotational angles or not?
Report Abuse
NXTBoy is not online. NXTBoy
Joined: 25 Aug 2008
Total Posts: 4533
26 Jun 2012 08:42 AM
I'm with oysi here. Whether your script works or not, there's little value in doing it. Gimbal lock is a result representing a rotation with euler angles. Use quaternions or matrices, and the problem does not exist.
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
26 Jun 2012 08:47 AM
*sigh*

Never mind. I'll do this on my own as usual.

Useless forum.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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