Essential Math Weblog Thoughts on math for games


Errata: Figure 1.9

Filed under: Erratical — Jim @ 9:23 am

Reported by Richard Ruth: In Figure 1.9 on Page 26, the label on the hypotenuse should be .


A New Beginning

Filed under: General — Jim @ 4:04 pm

Been a little busy lately trying to get a game out, but I did manage to squeeze in some time to create this new site using WordPress. It has some advantages in that I can display math and code a little easier, as you can see. I’m using MimeTeX for the math display — it’s got some issues with bold fonts, but otherwise I can enter the formulas I need in a LaTeX-like way without anyone needing to install MathML fonts. For the code, I’m using iG: Syntax Hiliter, with some tweaks to the colors.

Hopefully I’ll have some time in the next few weeks to type up some more errata, and what I and my co-lecturers are up to as we prep for GDC 2005.


Getting Axis and Angle from Rotation Matrix

Filed under: Erratical,Mathematical — Jim @ 11:36 am

There is a bug in the code that gets the axis and angle information from a rotation matrix. Where the angle is 180 degrees (the last else statement) it computes the reciprocal value incorrectly. The original code is:
float recip = 0.5f/s;
The fixed code should be:
float recip = 1.0f/s;
This should be corrected in both IvMatrix33 and IvMatrix44.


Correction: Quaternion Creation

Filed under: Erratical,Mathematical — Jim @ 8:37 pm

This is both a correction, and an improvement to the creation of a quaternion from two vectors. Or as it is commonly known, Shortest RotationArc.

The current code doesn’t handle the case where the two vectors are opposing; there’s an if statement to detect it, and a comment, but no recovery code. The problem is that there are an infinite number of orthogonal rotation axes — we just need to pick one. The solution is to check to see which axis the start vector (it could be the finish vector, it doesn’t matter) is generally pointing along. If it’s pointing generally along the -axis, then we take the cross product with the -axis to get our rotation axis. Otherwise we take the cross product with the -axis.


Correction: Quaternions

Filed under: Erratical,Mathematical — Jim @ 9:35 pm

Ah, our first errata. How bittersweet.

Eric Mumau sent me this one. On page 499, equation 10.11 is wrong. It should read:

Correspondingly, the following equation should read:

The rest of the page follows as before.

This affects the code which starts at the bottom of page 499. At the top of 500, the first three lines should be rewritten as:
float vMult = 2.0f*(x*vector.x + y*vector.y + z*vector.z);
float crossMult = 2.0f*w;
float pMult = crossMult*w – 1.0f;
Note that the code on the CD is not the same as that given in the text, and in fact will actually work. However, it is slightly less efficient than what is given here.


Post GDC musings

Filed under: General — Jim @ 9:21 pm

So it’s been about a month and a half since GDC. Our book was a success, selling out the show floor completely. The course seemed to go over well, too. Despite my complete loss of voice (after the talk it was actually gone for a whole day), folks seemed to like it, giving us the best ratings I’ve seen since I started doing the thing five years ago. So after the celebratory martinis and steak, now what?

Well, this blog is part of that. What we’d like to do is keep learning and writing about these topics, and expanding on both the book and the course. So we might post about we’re currently working on, or maybe expand on a topic we covered in the course or the book. We hope you’ll enjoy it.

« Newer Posts

Powered by WordPress

Fatal error: Uncaught exception 'wfWAFStorageFileException' with message 'Unable to verify temporary file contents for atomic writing.' in /home/jvsquare/public_html/essentialmath/blog/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php:47 Stack trace: #0 /home/jvsquare/public_html/essentialmath/blog/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php(650): wfWAFStorageFile::atomicFilePutContents('/home/jvsquare/...', '<?php exit('Acc...') #1 [internal function]: wfWAFStorageFile->saveConfig('livewaf') #2 {main} thrown in /home/jvsquare/public_html/essentialmath/blog/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php on line 47