1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<HTML> 3<HEAD> 4<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<META name="GENERATOR" content="Microsoft FrontPage 5.0"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css"> 8<TITLE>GXInitLightDir</TITLE> 9</HEAD> 10<BODY> 11<H1 align="left">GXInitLightDir</H1> 12 13<H2>Syntax</H2> 14<dl><dd><pre class="construction"> 15#include <revolution/gx.h> 16 17void GXInitLightDir( 18 <A href="../Structures/GXLightObj.html">GXLightObj</A>* lt_obj, 19 f32 nx, 20 f32 ny, 21 f32 nz ); 22</pre></dd></dl> 23 24<H2>Arguments</H2> 25<TABLE class="arguments" border="1" > 26 <TBODY> 27 <TR> 28<TH>lt_obj</TH> 29<TD>Pointer to a light object.</TD> 30 </TR> 31 <TR> 32<TH>nx</TH> 33<TD>X coordinate for the light direction.</TD> 34 </TR> 35 <TR> 36<TH>ny</TH> 37<TD>Y coordinate for the light direction.</TD> 38 </TR> 39 <TR> 40<TH>nz</TH> 41<TD>Z coordinate for the light direction</TD> 42 </TR> 43 </TBODY> 44</TABLE> 45 46<H2>Return Values</H2> 47<P>None.</P> 48 49<H2>Description</H2> 50<P>This function sets the direction of light in the light object. This direction is used when the light object is used as spotlight (see the <SPAN class="argument">attn_fn</SPAN> argument of the <A href="GXSetChanCtrl.html"><CODE>GXSetChanCtrl</CODE></A> function). The memory for the light object must be allocated by the application; this function does not load any hardware registers. To load a light object into a hardware light, use the <A href="GXLoadLightObjImm.html"><CODE>GXLoadLightObjImm</CODE></A> or <A href="GXLoadLightObjIndx.html"><CODE>GXLoadLightObjIndx</CODE></A> function.</P> 51<P>The coordinate space of the light direction should be consistent with a vertex normal transformed by a normal matrix; i.e., it should be transformed to view space. The direction vector is required to be normalized.</P> 52<P><B>Note:</B> This function can't specify the direction of parallel directional diffuse lights. To use parallel diffuse lights, place the light position very far from all objects to be lit. (See the <A href="GXGetLightPos.html"><CODE>GXInitLightPos</CODE></A> and <A href="GXSetChanCtrl.html"><CODE>GXSetChanCtrl</CODE></A> functions.)</P> 53 54<H2>See Also</H2> 55<P class="reference"> 56<A href="GXInitLightPos.html">GXInitLightPos</A>, 57<A href="GXLoadLightObjImm.html">GXLoadLightObjImm</A>, 58<A href="GXLoadLightObjIndx.html">GXLoadLightObjIndx</A>, 59<A href="GXSetChanCtrl.html">GXSetChanCtrl</A>, 60<A href="GXGetLightDir.html">GXGetLightDir</A>, 61<A href="GXLightObjInitFlow.html">GXLightObj Initialization Flow</A> 62</P> 63 64<H2>Revision History</H2> 65<P> 662006/03/01 Initial version.<br> 67</P> 68 69<hr><p>CONFIDENTIAL</p></body> 70</HTML>