logo back up home forward   further reading more topics »

Maths - Conversion Quaternion to Euler - Forum

By: Nobody/Anonymous - nobody
file Conversion Quaternion to Euler  
2005-01-20 06:30

http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/index.htm 
 
in the 2nd code example (non-normalised quaternion) these 4 lines need to be moved to beginning of function: 
 
double sqw = q1.w*q1.w; 
double sqx = q1.x*q1.x; 
double sqy = q1.y*q1.y; 
double sqz = q1.z*q1.z; 
 
 
ie to above this line which references them: 
double unit = sqx + sqy + sqz + sqw; 
// if normalised is one, otherwise is correction factor 
 
 
great site by the way, keep up the good work. 

By: Martin Baker - martinbaker
file RE: Conversion Quaternion to Euler  
2005-01-20 08:58

Thanks again, 
 
Martin


metadata block
see also:

 

Correspondence about this page

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.

cover If you are interested in 3D games, this looks like a good book to have on the shelf. If, like me, you want to have know the theory and how it is derived then there is a lot for you here. Including - Graphics pipeline, scenegraph, picking, collision detection, bezier curves, surfaces, key frame animation, level of detail, terrain, quadtrees & octtrees, special effects, numerical methods. Includes CDROM with code.

Commercial Software Shop

Where I can, I have put links to Amazon for commercial software, not directly related to the software project, but related to the subject being discussed, click on the appropriate country flag to get more details of the software or to buy it from them.

 

cover Dark Basic Professional Edition - It is better to get this professional edition

cover This is a version of basic designed for building games, for example to rotate a cube you might do the following:
make object cube 1,100
for x=1 to 360
rotate object 1,x,x,0
next x

cover Game Programming with Darkbasic - book for above software

Can you help?

Please send me any improvements to here. I would appreciate ideas to make the pages more useful including error correction, ideas for new pages, improvements to wording. It helps if you quote the full URL of the page.

 

progam

I am working on a project which uses these principles, if you would like to help me with this you are welcome to join in, here:

http://sourceforge.net/projects/mjbworld/

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2008 Martin John Baker - All rights reserved.