+ Reply to Thread
Results 1 to 4 of 4

Thread: [REQ] E2 Quaternions Tutorial

  1. #1
    Lifetime Supporter rich_27's Avatar
    Join Date
    Aug 2007
    Location
    findByUser("rich_27"):pos()
    Posts
    224

    Default [REQ] E2 Quaternions Tutorial

    I noticed the new quaternions section in the Expression 2 wiki, and did not know how to use them or exactly what they were. All I know is that they can be used in rotating things to beat gimbal lock I think. So I was wondering if anyone could make a tutorial on how to use them for rotating things.

    Much appreciated,
    Rich

  2. #2
    Wire Noob Xeronage's Avatar
    Join Date
    Aug 2009
    Posts
    1

    Default Re: [REQ] E2 Quaternions Tutorial

    They're 4D complex numbers. If you don't know what they are, you won't need them. They basicly work just like vectors actually...

  3. #3
    Wire Sofaking nescalona's Avatar
    Join Date
    Apr 2007
    Location
    Shoreline, Washington
    Posts
    1,299

    Default Re: [REQ] E2 Quaternions Tutorial

    I don't know how to use them myself, but perhaps this link can help.

    [ame=http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation]Quaternions and spatial rotation - Wikipedia, the free encyclopedia[/ame]

    It gets a little heavy in the middle, but don't give up: pseudocode for rotation operations is at the end.
    Last edited by nescalona; 08-22-2009 at 07:36 PM.

  4. #4
    Wire Sofaking Fizyk's Avatar
    Join Date
    Jun 2008
    Location
    Łomianki, Poland
    Posts
    740
    Blog Entries
    1

    Default Re: [REQ] E2 Quaternions Tutorial

    Right now the quaternions can only be used to rotate vectors. To rotate a vector using a quaternion, you basically do:

    VRotated = vec((Q*V)/Q)

    Or, if Q is a unit quaternion (for example generated with qRotate):

    VRotated = vec(Q*V*conj(Q))

    That's basically all there is to do now, you can also perform basic arithmetic on quaternions, but it's not very useful.

    I have an idea to make it possible to set holograms orientation with quaternions, just like it's done with angles, for example holoQuat(N,Q). It could be then used to animate holograms, as quaternions are easily interpolated using SLERP. What do you think?

    My programs: BIOS - Alcyone - Calculator - Notepad - Movie Player
    My tutorials: applyTorque - Quaternions - PID controllers
    Some other things I made: FT Chip - RK4 Solar System

+ Reply to Thread

Similar Threads

  1. Pac's E2 Tutorial
    By Nicolai1 in forum Gate Nostalgia (Old School Wiring) Discussion & Help
    Replies: 27
    Last Post: 04-12-2009, 08:02 AM
  2. Need tutorial :(
    By busido95 in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 5
    Last Post: 02-10-2009, 12:10 PM
  3. Quaternions?
    By Syranide in forum Wiremod General Chat
    Replies: 4
    Last Post: 02-09-2008, 06:09 AM
  4. Need tutorial
    By fredrik123 in forum Installation and Malfunctions Support
    Replies: 2
    Last Post: 11-11-2007, 11:35 AM
  5. Putting a video tutorial in the gmod tutorial list
    By Def the world in forum Installation and Malfunctions Support
    Replies: 1
    Last Post: 08-21-2007, 10:04 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots