Author Topic: Quaternion Rotations in Yabasic and Actionscript  (Read 4904 times)

0 Members and 1 Guest are viewing this topic.

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
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.
You are our 9001st visitor.
Challenge Trophies Won:

Offline Kirl

  • Senior Member
  • Pentium
  • ********
  • Posts: 1215
  • Karma: 230
    • View Profile
    • Homepage
Excellent work CK, I'll defenatly look into this soon! K+ :)
www.kirl.nl
Challenge Trophies Won:

Offline Kirl

  • Senior Member
  • Pentium
  • ********
  • Posts: 1215
  • Karma: 230
    • View Profile
    • Homepage
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!
www.kirl.nl
Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
I wasn't sure how to present it. There's an explanation of how Euler and Quaternions differ - was I close?
You are our 9001st visitor.
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17394
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
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+
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Kirl

  • Senior Member
  • Pentium
  • ********
  • Posts: 1215
  • Karma: 230
    • View Profile
    • Homepage
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
www.kirl.nl
Challenge Trophies Won:

Offline Kirl

  • Senior Member
  • Pentium
  • ********
  • Posts: 1215
  • Karma: 230
    • View Profile
    • Homepage
Ah, the text file looks much more enlightening then the code did! ;)

Nice ascii drawings as well!  :clap:
www.kirl.nl
Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Good idea - I'll put together a gimbal demo.

K+ for the quick feedback.
You are our 9001st visitor.
Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Nice on CK, I'll take a look later and probably learn a thing or two :) K++
raizor

Challenge Trophies Won: