From a unit vector, we can get an orthonormal basis vectors in 3D space easily. Given we have a unit vector * R*, and we’re to build three vectors

*,*

**R***,*

**S***which will construct a new orthonormal basis.*

**T**- Set the smallest (in absolute value) component of
to**R****zero**. - Exchange the other two components of
and then negate the first one.**R,**= ( 0, –**S**,**R**z), in case**R**yis smallest.**R**x

- Normalize vector
.**S**=**S**/ |**S**|**S**

- Last vector
is a cross product of**T**and**R**then.**S**=**T**x**R****S**

Simple steps.

*I’m just summarizing a method from a paper, **Building an orthonormal basis from a unit vector** by John F. Hughes and Thomas Moller.*