Advertisement

quaternions

Started by May 01, 2000 09:15 PM
36 comments, last by a2k 24 years, 6 months ago
i''m working on a 3d game that requires motion on all axes. is quaternions really the way to go, or should i just stick with the ol'' trig matrices? quaternions look pretty ugly, and am wondering if they''re worth learning. a2k
------------------General Equation, this is Private Function reporting for duty, sir!a2k
It depends on what you want to do.

If your objects can be at any orientation at any time and you want the objects to rotate left/right, up/down and clockwise/counter-clockwise. Then you will definitly want to use quaternions.

If your objects are going to be at a certain orientation (for a player charater in a FPS or a 3D RPG may rotate around the y axis (turn left and right) and around the x axis (lean forward or lean backward) then you don''t have to use quaternions.

TC

Advertisement
Yes.. if you want to avoid gimbal Lock and smooth interpolation (camera position)

They are not too bad unless you really want to understand why they works.. most of the time , just take the maths..
yeah, it's gonna be a flight type of game, so what advantages would i get by using quaternions, and what's the learning curve?

any good links to some documentation? the ones in the programming section on gamedev aren't the greatest...

a2k

Edited by - a2k on 5/1/00 9:51:16 PM
------------------General Equation, this is Private Function reporting for duty, sir!a2k
There is no learning cureve I decided to go for quaternions in my 3D engine (which is made for a 3D space racing game), and I switched from matrices to quaternions in about three or four hours. Of course, you still have to use matrices when transforming your vertices in the rendering pipeline, but that''s just a matter of converting the quaternion to a matrix and adding the translation.

Check this out: Matrix & Quaternion FAQ


/ LC
-------------------------------------------------------------LGPL 3D engine - http://www.sourceforge.net/projects/realityengine
Try www.gamasutra.com

and search for Nick Bobbit''s article..

Also, Jeff Lander''s has some good quaternion tutorials but in OpenGL
www.darwin3d.com

Just take note the normalization function in the Quaternion FAQ is wrong. The maintainer has confirmed the bug with me but not yet posted an update.

About learning curve, depends on how much you want to get into.. I took a very long time, but then I am new to 3D and doing something totally way beyond my capability.
Advertisement
hey lord chaos, you got any screenshots of your space racing game?

a2k
------------------General Equation, this is Private Function reporting for duty, sir!a2k
Yes I have, but nothing I want to show to the public at the moment We have planned to have a first demo finished in two weeks.

/ LC
-------------------------------------------------------------LGPL 3D engine - http://www.sourceforge.net/projects/realityengine
cool. i'm looking forward to it.

also, are there any good quaternion implementations out there, or do i have to make one myself?

a2k

Edited by - a2k on 5/2/00 8:31:37 PM
------------------General Equation, this is Private Function reporting for duty, sir!a2k
If you''d like to see a demo that uses quaternions. Checkout my page:

www.mindspring.com/~tim.craig/test/ControllerTest.html

It works with IE 4, IE 5 and Netscape 4.7 browsers (Although someone told me it dosen''t work on NS 4.7 on win NT).

This topic is closed to new replies.

Advertisement