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
 

@ Matrix Math Wizards

Previous Thread :: Next Thread 
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
01 Jul 2012 08:14 PM
I've got a function (below) that extracts Euler angles from a part's CFrame matrix. It does this fine and perfect if only one angle is not 0. If it is rotated in more than one axis, then the function just doesn't return what I thought it should (which is the Euler angles).

function GetAngles(m)
-- ''m'' is the given matrix (CFrame)
local sx, sy, sz, 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 math.deg(x), math.deg(y), math.deg(z)
elseif m10 < -.998 then
x = math.atan2(m02, m22)
y = -math.pi/2
z = 0
return math.deg(x), math.deg(y), math.deg(z)
end
x = math.atan2(-m20, m00)
y = math.atan2(-m12, m11)
z = math.asin(m10)
return math.deg(x), math.deg(y), math.deg(z)
end

HotThoth please.
Report Abuse
eyeontheprizeREBOOT is not online. eyeontheprizeREBOOT
Joined: 30 Jan 2011
Total Posts: 1555
01 Jul 2012 08:18 PM
Try stackoverflow. They're way better than here.
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
01 Jul 2012 08:54 PM
Mkay...now how do I use that?
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
01 Jul 2012 09:01 PM
[ Content Deleted ]
Report Abuse
popinman322 is not online. popinman322
Joined: 04 Mar 2009
Total Posts: 5184
01 Jul 2012 09:37 PM
NOTICE: If you want to do it right, look inside RobloxApp.exe.
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
01 Jul 2012 11:28 PM
@Oysi

What I'm trying to do is stop myself from giggling at your post. Because it sounds so low...
Report Abuse
DonnyTheDemented is not online. DonnyTheDemented
Joined: 29 May 2010
Total Posts: 1413
01 Jul 2012 11:37 PM
Why not just use the lookvector property? I would think you could extract the angles from the triangles it makes with the axis.
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
02 Jul 2012 12:43 AM
[ Content Deleted ]
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
02 Jul 2012 12:43 AM
[ Content Deleted ]
Report Abuse
LPGhatguy is online. LPGhatguy
Forum Moderator
Joined: 27 Jun 2008
Total Posts: 4725
02 Jul 2012 01:47 AM
Can't you just use the `toEulerAnglesXYZ` method? Or are you opposed to that? Or are you just trying to get the math behind?
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
02 Jul 2012 08:11 AM
I'm just trying to figure out the math behind it all. Just because I can.

I've got it to work for when one angle is changed...but multiple... -.-
Report Abuse
popinman322 is not online. popinman322
Joined: 04 Mar 2009
Total Posts: 5184
02 Jul 2012 08:18 AM
Like I said, it's in RobloxApp.exe.
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
02 Jul 2012 08:23 AM
So find it. Because I have no idea how to look through the functions in that thing.
Report Abuse
popinman322 is not online. popinman322
Joined: 04 Mar 2009
Total Posts: 5184
02 Jul 2012 08:34 AM
sub_83E8D0, good luck
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
02 Jul 2012 08:36 AM
It isn't in the App......I looked.
Report Abuse
popinman322 is not online. popinman322
Joined: 04 Mar 2009
Total Posts: 5184
02 Jul 2012 08:37 AM
You have to use something like Ollydbg or IDA Pro, just navigate to the address(remove sub_).

That's the actual subroutine for toEulerAnglesXYZ().
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
02 Jul 2012 08:40 AM
Resource Tuner?
Report Abuse
popinman322 is not online. popinman322
Joined: 04 Mar 2009
Total Posts: 5184
02 Jul 2012 08:43 AM
It's not a resource, it's a C function, and therefore you can only go through it via a debugger.

You might want to actually step through it instruction by instruction as well, I'm not entirely sure what it's doing. @_@
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
02 Jul 2012 08:44 AM
Yeah...lots of analyzing going on.
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
02 Jul 2012 08:52 AM
"and break do else elseif end false for function if in local nil not or repeat return then true until while"

Look...I found the list of all highlighted keywords...
Report Abuse
popinman322 is not online. popinman322
Joined: 04 Mar 2009
Total Posts: 5184
02 Jul 2012 08:54 AM
Shindeed, many interesting things reside within the application.
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
02 Jul 2012 10:55 AM
Yeah...I give up. The functions are all in the rdata folder which is compressed in the .exe file. I don't know how to correctly read this rdata, or if you even can.
Report Abuse
popinman322 is not online. popinman322
Joined: 04 Mar 2009
Total Posts: 5184
02 Jul 2012 11:19 AM
mov eax, off_DE1504
sub esp, 0Ch
push esi
mov esi, [esp+10h+arg_0]
push eax
push 1
push esi
call sub_832E50
add esp, 0Ch
lea ecx, [esp+10h+var_4]
push ecx
lea edx, [esp+14h+var_8]
push edx
lea ecx, [esp+18h+var_C]
push ecx
mov ecx, eax
call sub_62C6C0
fld [esp+10h+var_C]
sub esp, 8
fstp [esp+18h+var_18]
push esi ; int
call sub_8316F0
fld [esp+1Ch+var_8]
add esp, 4
fstp [esp+18h+var_18]
push esi ; int
call sub_8316F0
fld [esp+1Ch+var_4]
add esp, 4
fstp [esp+18h+var_18]
push esi ; int
call sub_8316F0
add esp, 0Ch
mov eax, 3
pop esi
add esp, 0Ch
retn
Report Abuse
popinman322 is not online. popinman322
Joined: 04 Mar 2009
Total Posts: 5184
02 Jul 2012 11:19 AM
var_18= qword ptr -18h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr 4
Report Abuse
booing is not online. booing
Joined: 04 May 2009
Total Posts: 6594
02 Jul 2012 11:55 AM
I wish ida did more work to find the names of things... Either that or I'm a stupid idiot who hasn't used it enough and whines because I know assemby and can code in it but not read it
>:(
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 2Go to page: [1], 2 Next
 
 
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