PDA

View Full Version : GimbalRock - demo of rotations via gimbals



dcromley
23-11-2011, 00:44
I've always been intrigued by rotation mathematics. Finding thinBasic/TBGL was a great life opportunity. Matrix math has always been understandable and reliable. Quaternion math is as good or better, but not understandable (to me). Euler Angles can be used in a simple manner, but the results are poor -- the rotations lose their naturalness after the object leaves the home position. The math to use Euler Angles making the rotations more natural is not easy. I have wondered if it was even possible. Then I stumbled on a paper by Jed Margolin which didn't give the solution, but showed how to get the solution, which I was able to get. And the result is this program.

It shows a head supported by gimbals (my avatar) that can be controlled by the keyboard. You can use either the simple controls or the natural controls. Hit F1 for info.

It's zipped because I have "Include" files, so it may be best to put it in a separate directory. In the zipped directory, there's also a "GLFigures" program that uses that same "Include" files. It isn't done -- it's for testing.

I've posted the "bundled" executable at http://dbarc.net/dcgimbalrock.exe (may have to turn antivirus off). The mathematics paper is at http://dbarc.net/dceulerrot.pdf.

Thanks for existing, Regards, Dave

REDEBOLT
23-11-2011, 02:03
That's really neat.

:D

Thanks,
Bob

zak
23-11-2011, 04:21
i can't express enough how much this is beautiful
thank you

dcromley
23-11-2011, 04:42
Thank you.
I just noticed that in GLFigures.tbasic, there are 2 instances of "Lerp2" This may not work except in the latest download. Change those to "zLerp".

ErosOlmi
23-11-2011, 08:23
Fantastic Dave :eek:
I have no words. I could not even imagine how great minds can get out from thinBasic.

John Spikowski
23-11-2011, 08:57
Nice job Dave!

If you hold all 4 arrow keys down at once, you get a predictable but all view presentation. (at least I do under Linux/Wine)

P.S.

Ran from a .exe thinBASIC package.

Petr Schreiber
23-11-2011, 10:17
Great example! Thanks a lot Dave!
It run perfectly here...

...I liked very much the help screen too.


Petr

dcromley
26-11-2011, 18:41
Thanks for the nice comments.
V1.1 - I just had to make the eyes blink.
Also at http://dbarc.net/dcgimbalrock.exe

Petr Schreiber
26-11-2011, 18:56
Hehe,

I didn't read your description carefully, so I didn't expect the head to blink. When it did, I almost fell from my chair :D


Petr

dcromley
28-11-2011, 19:01
I had the giggles all day yesterday, thinking about your
"almost fell from my chair".
How FUNNY! Thanks.

zak
28-11-2011, 20:39
i am hardly noticed the blink, because i am blinking naturaly too much and it happened the toy blink when i blink. so i have increased the blink periods:
If zSTTimer01(1, sngl1) > .2 Then...
thanks

DirectuX
30-12-2019, 09:57
The mathematics paper is at http://dbarc.net/dceulerrot.pdf.


Note: This previous link from post #1 is broken, but script's F1 help indicate http://dbarc.net/eulerrot.pdf which is good.