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 
HotThoth is not online. HotThoth
Forum Moderator
Joined: 24 Aug 2010
Total Posts: 1176
02 Jul 2012 12:35 PM
Remember, the function you're talking about is "ToEulerAnglesXYZ" (so it matches CFrame.Angles == CFrame.FromEulerAnglesXYZ), which means that the rotations are applied in X-->Y-->Z ordering. It looks like you are using a different ordering for your function, which means when you try to apply more than one rotation at once, you'll get differences with what you're expecting.

Aside from that, the gist of the function looks right, though. But unfortunately, a different ordering means all of your variables are kinda scrambled around from the ordering you'd want (i.e. for your outside "if" statements, you'd probably want to use m02 instead).


- HotThoth
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
02 Jul 2012 02:33 PM
@HotThoth

I did figure out that ROBLOX seems to have a different order than was is traditional. Simple, though, the x and y just need to be flipped.
Report Abuse
stravant is not online. stravant
Forum Moderator
Joined: 22 Oct 2007
Total Posts: 2893
02 Jul 2012 04:22 PM
"I wish ida did more work to find the names of things... "

In case you did not realize, there _are no_ names for it to find. Any names of local variables and members and what not are just a convenience for you, the programmer: they don't actually exist anywhere in a compiled executable.
Report Abuse
NXTBoy is not online. NXTBoy
Joined: 25 Aug 2008
Total Posts: 4533
02 Jul 2012 05:53 PM
> Well, actually it contains the backvector, but negate that and you got lookvector

What? Surely lookVector is just

(cf - cf.p) * Vector3.new(0, 0, 1)

In which case the components themselves must be in the matrix (not negated).
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
02 Jul 2012 07:01 PM
[ Content Deleted ]
Report Abuse
stravant is not online. stravant
Forum Moderator
Joined: 22 Oct 2007
Total Posts: 2893
03 Jul 2012 01:16 PM
"What? Surely lookVector is just
(cf - cf.p) * Vector3.new(0, 0, 1)"

Like Oysi pointed out, there's no need to do that. All that does is require a bunch of extra multiplies and adds, most of which will be x*0 and x+0. You can just directly extract the basis vectors from the components.
Report Abuse
Previous Thread :: Next Thread 
Page 2 of 2Go to page: 1, [2] Prev
 
 
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