Game Development Reference
In-Depth Information
Itismorepracticalhowevertorepresent w andhintermsofthenearandfarclippingplane
and the viewport's resolution (v w , v h ).
4.2.2 View
Next is the view matrix, this matrix is used to transform all the geometry from world space
into camera or view space. In view space, the camera is at the origin looking down the
positive z axis (left handed coordinate system). The view matrix can be thought of as the
concatenation of the translation and rotation matrices for each axis by which the geometry
will be transformed to bring it in front of the viewer. The translation and rotation proper-
ties of the view matrix are based on the camera's position and orientation in world space,
thematrixwillapplyrotationsofoppositemagnitude totherotationofthemodelsinworld
space and translate the object into view space.
Given the position of the camera, and a point in space to which we wish to look towards,
we can derive vectors that describe the orientation for each of the camera's axes.
We start by creating the basis vectors for the rotation, the forward direction is the subtrac-
tionofthelookatposition l bythecamera'sworldspaceposition c ,wealsoneedtoprovide
the world's up axis, u world .
Search WWH ::




Custom Search