How to rotate about arbitrary axis?

If I specify a rotation as follows…



[java]Quaternion q = new Quaternion();

q.fromAngleAxis(FastMath.PI/4f, new Vector3f(0,1,0));

geom.rotate(q);[/java]



… and suppose the geometry is just the unit cube about the origin, then it rotates about the y-axis as expected.



But what if I want to rotate the cube at one of its edges, and not the middle? In other words, it is as if the origin is moved to the edge of the cube that I want to rotate.



Hope this makes sense.

D’oh, I suppose this is the answer:



https://wiki.jmonkeyengine.org/legacy/doku.php/jme2:rotate_about_a_point?s[]=rotation

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:math_for_dummies