Euler Angles vs. Angles

View previous topic View next topic Go down

Euler Angles vs. Angles

Post by fredsmith on Mon Jan 31, 2011 7:31 pm

First thing, is it true that:
1. _AX() is buggy
2. _AX(), _AY(), and _AZ() are deprecated, and therefore we should avoid using them

If those are true, it follows that we should be using Euler angles instead (like the English Documentation tells us to), right?

Therefore, we either need function(s) that can convert between those two, or a tutorial explaining Euler angles. (I myself have no idea about Euler angles, even after reading the Wiki article)
avatar
fredsmith
Hover
Hover

Posts : 109
Join date : 2011-01-19
Location : Nowhere and everywhere.

View user profile http://lmgtfy.com/?q=rigidchips

Back to top Go down

Re: Euler Angles vs. Angles

Post by JHaskly on Mon Jan 31, 2011 11:48 pm

2. I don't really think that "deprecated" matters. It's not like they are going to be phased out in a later version Laughing

1. I'm not sure about this, as I don't use _AX

I'm not actually sure that there is a difference. If there is, Bwansy should be able to explain it Razz

However, _EX is also not quite suitable as it is. If the model is facing south, it inverts (I think it's south...). But this can easily be rectified.


_________________
Previously (and currently) known as Juz.

Please do not write "LUA", beause it's "Lua". It's Moon in Portuguese, not a Limited User Account, Last Universal Ancestor, or the Lukla Airport in Nepal.

JHaskly
Admin

Posts : 235
Join date : 2010-07-16
Age : 21
Location : Brisbane

View user profile

Back to top Go down

Re: Euler Angles vs. Angles

Post by fredsmith on Tue Feb 01, 2011 11:18 pm

LOL Okay then... I'll wait for Bwansy to reply. XD

EDIT: Okay, looking at Chris220's Lua library, we find that he fixed _EX() by doing this:
Code:
function ex(chipNum)
   if(-math.pi<=_EY(chipNum) and _EY(chipNum)<=-math.pi/2) or (math.pi/2<=_EY(chipNum) and _EY(chipNum)<=math.pi) then
      local ex = -_EX(chipNum)
      return ex
   else
      local ex = _EX(chipNum)
      return ex
   end
end

In his library documentation, this is what it says...

ex() documentation wrote:Format:
ex(chipNum);

Description:
Outputs the euler X radian. Fixed bug of _EX() being reversed when model is rotated 180 degrees.

Example:
local EulerX = ex(CORE);
avatar
fredsmith
Hover
Hover

Posts : 109
Join date : 2011-01-19
Location : Nowhere and everywhere.

View user profile http://lmgtfy.com/?q=rigidchips

Back to top Go down

Re: Euler Angles vs. Angles

Post by JHaskly on Wed Feb 02, 2011 11:36 pm

I wouldn't have done that. Too much code Razz

Code:
-_EX(chip)*math.sgn(_ZZ(chip))

_________________
Previously (and currently) known as Juz.

Please do not write "LUA", beause it's "Lua". It's Moon in Portuguese, not a Limited User Account, Last Universal Ancestor, or the Lukla Airport in Nepal.

JHaskly
Admin

Posts : 235
Join date : 2010-07-16
Age : 21
Location : Brisbane

View user profile

Back to top Go down

Re: Euler Angles vs. Angles

Post by bwansy on Thu Feb 03, 2011 5:12 am

According to the Japanese documentations, _EX/Y/Z() are the same as _AX/Y/Z(), but "optimised and works faster", but both are buggy. I can't tell for now exactly how _AX() is buggy, because like Juz, I've seldom used _AX/Y/Z(). And Juz is right about how to fix _EX().

_________________
A.K.A. Bernard

bwansy
Admin

Posts : 170
Join date : 2010-07-15

View user profile http://rigidchips.forum-motion.com

Back to top Go down

Re: Euler Angles vs. Angles

Post by fredsmith on Thu Feb 03, 2011 4:56 pm

Okay, thank you.

EDIT: Wait, so it's
Code:
function ex(chip)
    return -_EX(chip)*math.sgn(_ZZ(chip))
end
?
avatar
fredsmith
Hover
Hover

Posts : 109
Join date : 2011-01-19
Location : Nowhere and everywhere.

View user profile http://lmgtfy.com/?q=rigidchips

Back to top Go down

Re: Euler Angles vs. Angles

Post by bwansy on Thu Feb 03, 2011 5:12 pm

Yes.

_________________
A.K.A. Bernard

bwansy
Admin

Posts : 170
Join date : 2010-07-15

View user profile http://rigidchips.forum-motion.com

Back to top Go down

Re: Euler Angles vs. Angles

Post by fredsmith on Thu Feb 03, 2011 8:16 pm

Thanks.
avatar
fredsmith
Hover
Hover

Posts : 109
Join date : 2011-01-19
Location : Nowhere and everywhere.

View user profile http://lmgtfy.com/?q=rigidchips

Back to top Go down

Re: Euler Angles vs. Angles

Post by Chris220 on Sun Feb 06, 2011 5:15 am

JHaskly wrote:I wouldn't have done that. Too much code Razz

Code:
-_EX(chip)*math.sgn(_ZZ(chip))
Yeah, that's what I used in my update Lua library (never released because I didn't think anyone would use it)

The fix posted above was something I set up years ago, I think bwansy may have helped out with it Razz

The best thing to use for a lot of cases, especially with 3D physical applications, is quaternion angles. They're a bit confusing to learn about at first, but relatively simple if you understand them. The reason they're so useful is that, due to their nature, they avoid the issue of the gimbal lock.

_________________
mov ah,9
mov dl,msg
int 21h
int 20h

msg db "lolol",36h
avatar
Chris220
Moderator

Posts : 58
Join date : 2010-07-15
Age : 24
Location : Right behind you

View user profile

Back to top Go down

Re: Euler Angles vs. Angles

Post by fredsmith on Sun Feb 06, 2011 6:35 pm

LOL well... I'm still taking my time learning physics... most of the stuff here is already beyond what I'm learning at school: I'm in Physics 12. I haven't even graduated from high school yet. Wink
avatar
fredsmith
Hover
Hover

Posts : 109
Join date : 2011-01-19
Location : Nowhere and everywhere.

View user profile http://lmgtfy.com/?q=rigidchips

Back to top Go down

Re: Euler Angles vs. Angles

Post by Chris220 on Mon Feb 07, 2011 12:39 am

It's always nice to teach yourself extra stuff outside of school, means when you get round to studying it it's really easy! Razz

Take vector dot products for example. I've been using the dot product for ages now, for various things in my programming. I've only JUST started learning about it at college (I'm 18) Very Happy
I dunno why they left it so late - it's really easy xD

_________________
mov ah,9
mov dl,msg
int 21h
int 20h

msg db "lolol",36h
avatar
Chris220
Moderator

Posts : 58
Join date : 2010-07-15
Age : 24
Location : Right behind you

View user profile

Back to top Go down

Re: Euler Angles vs. Angles

Post by fredsmith on Mon Feb 07, 2011 7:59 pm

Yes, I agree haha, it's awesome to learn extra stuff when you have the time. It's also great to apply something you just learned in school to RC and other physics games. Wink
avatar
fredsmith
Hover
Hover

Posts : 109
Join date : 2011-01-19
Location : Nowhere and everywhere.

View user profile http://lmgtfy.com/?q=rigidchips

Back to top Go down

Re: Euler Angles vs. Angles

Post by DanielLC on Sat Feb 12, 2011 1:20 pm

Personally, I prefer quaternions.

I remember testing AX()... and them not being the same. I could be wrong though.

DanielLC
Tank
Tank

Posts : 78
Join date : 2010-10-23

View user profile

Back to top Go down

Re: Euler Angles vs. Angles

Post by RA2lover on Sat Dec 17, 2011 5:12 pm

i don't think that relates to the topic at all.

BTW i play algodoo too!
avatar
RA2lover
Walker
Walker

Posts : 382
Join date : 2010-10-11
Age : 22
Location : Brazil

View user profile

Back to top Go down

Re: Euler Angles vs. Angles

Post by freek4ever on Mon Dec 26, 2011 3:42 pm

I play algodoo too same username
avatar
freek4ever
Tank
Tank

Posts : 97
Join date : 2011-08-26
Age : 20
Location : nederland holand

View user profile

Back to top Go down

Re: Euler Angles vs. Angles

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum