RigidChips
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Euler Angles vs. Angles

+3
bwansy
JHaskly
fredsmith
7 posters

Go down

Euler Angles vs. Angles Empty Euler Angles vs. Angles

Post by fredsmith 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)
fredsmith
fredsmith
Hover
Hover

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

http://lmgtfy.com/?q=rigidchips

Back to top Go down

Euler Angles vs. Angles Empty Re: Euler Angles vs. Angles

Post by JHaskly 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.


JHaskly
Admin

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

Back to top Go down

Euler Angles vs. Angles Empty Re: Euler Angles vs. Angles

Post by fredsmith 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);
fredsmith
fredsmith
Hover
Hover

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

http://lmgtfy.com/?q=rigidchips

Back to top Go down

Euler Angles vs. Angles Empty Re: Euler Angles vs. Angles

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

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

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

JHaskly
Admin

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

Back to top Go down

Euler Angles vs. Angles Empty Re: Euler Angles vs. Angles

Post by bwansy 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().

bwansy
Admin

Posts : 170
Join date : 2010-07-15

https://rigidchips.forumotion.com

Back to top Go down

Euler Angles vs. Angles Empty Re: Euler Angles vs. Angles

Post by fredsmith 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
?
fredsmith
fredsmith
Hover
Hover

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

http://lmgtfy.com/?q=rigidchips

Back to top Go down

Euler Angles vs. Angles Empty Re: Euler Angles vs. Angles

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

Yes.

bwansy
Admin

Posts : 170
Join date : 2010-07-15

https://rigidchips.forumotion.com

Back to top Go down

Euler Angles vs. Angles Empty Re: Euler Angles vs. Angles

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

Thanks.
fredsmith
fredsmith
Hover
Hover

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

http://lmgtfy.com/?q=rigidchips

Back to top Go down

Euler Angles vs. Angles Empty Re: Euler Angles vs. Angles

Post by Chris220 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.
Chris220
Chris220
Moderator

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

Back to top Go down

Euler Angles vs. Angles Empty Re: Euler Angles vs. Angles

Post by fredsmith 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
fredsmith
fredsmith
Hover
Hover

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

http://lmgtfy.com/?q=rigidchips

Back to top Go down

Euler Angles vs. Angles Empty Re: Euler Angles vs. Angles

Post by Chris220 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
Chris220
Chris220
Moderator

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

Back to top Go down

Euler Angles vs. Angles Empty Re: Euler Angles vs. Angles

Post by fredsmith 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
fredsmith
fredsmith
Hover
Hover

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

http://lmgtfy.com/?q=rigidchips

Back to top Go down

Euler Angles vs. Angles Empty Re: Euler Angles vs. Angles

Post by DanielLC 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

Back to top Go down

Euler Angles vs. Angles Empty Re: Euler Angles vs. Angles

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

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

BTW i play algodoo too!
RA2lover
RA2lover
Walker
Walker

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

Back to top Go down

Euler Angles vs. Angles Empty Re: Euler Angles vs. Angles

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

I play algodoo too same username
freek4ever
freek4ever
Tank
Tank

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

Back to top Go down

Euler Angles vs. Angles Empty Re: Euler Angles vs. Angles

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


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