Device States and Transforms

Two items we've used in our sample code thus far that haven't been delved into are the various device states and transforms. There are three different state variables on the device: the render states, the sampler states, and the texture states. We've only used some of the render states thus far; the latter two are used for texturing. Don't worry; we'll get to texturing soon enough. The render state class can modify how Direct3D will do its rasterization of the scene. There are many different attributes that can be changed with this class, including lighting and culling, which we've used in our application already. Other options you can set with these render states include fill mode (such as wire frame mode) and various fog parameters. We will discuss more of these options in subsequent chapters.

As mentioned before, transformations are matrices used to convert geometry from one coordinate space to another. The three major transformations used on a device are the world, view, and projection transforms; however, there are a few other transforms that can be used. There are transforms that are used to modify texture stages, as well as up to 255 world matrices.



Managed DirectX 9 Graphics and Game Programming, Kick Start
Managed DirectX 9 Kick Start: Graphics and Game Programming
ISBN: B003D7JUW6
EAN: N/A
Year: 2002
Pages: 180
Authors: Tom Miller

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net