Basic View Orientation

If our robot is viewing the bench and chairs as indicated above, it will see the image oriented as shown below. In OpenGL's terms, we have defined the geometry of the bench and chairs in the model coordinate system, then we apply an affine transformation to this model coordinate geometry to obtain its representation in the "eye coordinate" (EC) system. By definition, the x-axis of EC is parallel to the horizontal direction on the screen, and the y-axis of EC is parallel to the vertical direction on the screen. We specify the EC system by prescribing the position of the eye, E, the center of attention, C, and an up vector. The values of these three parameters are specified in model coordinates and are illustrated in the image above.

A class method in cryph::Matrix4x4 can be used to create the matrix itself. Its declaration in Matrix4x4.h is (the cryph namespace prefixes have been omitted for brevity here):

static Matrix4x4 lookAt(const AffPoint& eye, const AffPoint& center, const AffVector& up);