Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
A version of this page is also available for
4/8/2010
A light's direction property determines the direction that the light emitted by the object travels, in world space. Direction is used only by directional lights and is described with a vector.
C++ applications set the light direction in the Directionmember of the light's D3DMLIGHTstructure. The Directionmember is of type D3DMVECTOR. Direction vectors are described as distances from a logical origin, regardless of the light's position in a scene. You can simulate sunlight shining directly on a scene by using a directional light whose direction is <0,-1,0>. You do not have to create lights that shine along the coordinate axes; you can mix and match values to create lights that shine at more interesting angles.
Note: |
---|
Although you do not need to normalize a light's direction vector, always be sure that it has magnitude. In other words, do not use a <0,0,0> direction vector. |