Dark Bit Factory & Gravity

PROGRAMMING => Coding tutorials => Topic started by: combatking0 on May 21, 2012

Title: Quaternion Rotations in Yabasic and Actionscript
Post by: combatking0 on May 21, 2012
After many years of being a member here, I have finally produced my first tutorial.

Many languages come with Quaternion functions built in. This tutorial has been made for the benefit of those who are coding in languages without Quaternion capabilities.

The Yabasic version is a bit sloppy, but runs smoother than the Actionscript version. Even if you don't have Flash, you can still view the ActionScript code using Notepad++ or Notepad by looking in the .as files.

You'll need Jim's Yabasic Emulator to edit or run the Yabasic version, or Flash 8 or higher to edit & recompile the AS version Flash Player 8 or higher to veiw the AS version.
Title: Re: Quaternion Rotations in Yabasic and Actionscript
Post by: Kirl on May 21, 2012
Excellent work CK, I'll defenatly look into this soon! K+ :)
Title: Re: Quaternion Rotations in Yabasic and Actionscript
Post by: Kirl on May 21, 2012
Aww, I thought a tutorial in the sense of a step by step explanation of what you're doing and why. Source code alone isn't as explanatory as a tutorial might be, but it should still be a very usefull read once I decide to go into this!
Title: Re: Quaternion Rotations in Yabasic and Actionscript
Post by: combatking0 on May 21, 2012
I wasn't sure how to present it. There's an explanation of how Euler and Quaternions differ - was I close?
Title: Re: Quaternion Rotations in Yabasic and Actionscript
Post by: Shockwave on May 21, 2012
The text file that accompanies the source gives a nice overview of what gimbal lock is and the differences and explains the concept of rotating the axis with the object.  I would have found this useful to understand some of the strange axis swapping problems I was getting when I was first starting to explore software 3D engines.

K+
Title: Re: Quaternion Rotations in Yabasic and Actionscript
Post by: Kirl on May 21, 2012
Oh, I must've overlooked the text file.  :whack:

It would be cool to make an interactive tool showing two gimbals with 3 axis of rotation, one using euler angles and the other quaternions. I know you did some really excellent learning tools.

I only remember gimbal lock from 3d software, I never actually encountered it yet in programming. I'm still happily residing in flatland, but things like cube challenges (as opposed to square challenges) encourage me to code upward, not northward. ;D
Title: Re: Quaternion Rotations in Yabasic and Actionscript
Post by: Kirl on May 21, 2012
Ah, the text file looks much more enlightening then the code did! ;)

Nice ascii drawings as well!  :clap:
Title: Re: Quaternion Rotations in Yabasic and Actionscript
Post by: combatking0 on May 22, 2012
Good idea - I'll put together a gimbal demo.

K+ for the quick feedback.
Title: Re: Quaternion Rotations in Yabasic and Actionscript
Post by: Raizor on May 22, 2012
Nice on CK, I'll take a look later and probably learn a thing or two :) K++