38 Chapter 2 The Mathematics of P articles
This algorithm is a simple way of generating an orthonormal basis from two given
axes. When we talk about contact detection and contact resolution later in the book,
we will need to create an orthonormal basis, but we’ll only have one fixed axis. We’ll
need to extend this algorithm accordingly.
Note that the construction of an orthonormal basis is a situation where it matters a
great deal whether you are working in a left- or right-handed coordinate system. The
previous algorithm is designed for right-handed systems. If you need a left-handed
coordinate system, then you can simply change the order of the operands for both the
cross-products. This will give you a left-handed orthonormal basis.
2.2 Calculus