[Algorithms] Rotation about arbitrary axis
Brought to you by:
vexxed72
From: Pierre T. <p.t...@wa...> - 2000-08-21 17:04:07
|
Hi, Since I needed a piece of code to do that I searched the web and found: http://www.iuk.tu-harburg.de/hypgraph/modeling/mod_tran/3drota.htm I used the final matrix at the bottom of the page, but it seems to fail when the arbitrary axis actually is the Z axis. The third column gets erased where it should at least contain a 1. This is obvious when looking at the provided matrix, since the third column of the third row depends on the rotation angle - and of course if the input axis already is the Z axis, it shouldn't. Now, it sounds normal regarding the underlying method (mapping the rotation axis to Z, etc). But I wonder whether there's an easy way to perform a real arbitrary rotation about any arbitrary axis without using different code paths according to the input axis. I think it can probably be done by introducing quaternions or better, angle-axis, in the story. But err.... maybe there's something simpler. Pierre |