DirectX tutorial #3

Links: Up

This sample corresponds to tutorial #3 in the Managed DirectX SDK, and was provided by Jack Palevich (thanks Jack!) You will need to have the Managed DirectX SDK installed, and to adjust the path settings in the Matricies.fsharpp project (if using Visual Studio) and/or set the MANAGED_DX environment variable (if using build.bat).

From the code: This tutorial renders 3D geometry. To deal with 3D geometry we need to introduce the use of 4x4 matrices to transform the geometry with translations, rotations, scaling, and setting up our camera. Geometry is defined in model space. We can move it (translation), rotate it (rotation), or stretch it (scaling) using a world transform. The geometry is then said to be in world space. Next, we need to position the camera, or eye point, somewhere to look at the geometry. Another transform, via the view matrix, is used, to position and rotate our view. With the geometry then in view space, our last transform is the projection transform, which "projects" the 3D scene into our 2D viewport.

The F# code in dxlib.fs contains some common functions used in the context of DirectX programming. The F# code in Matrices.fs is the main code for the sample.

Suggested Exercises