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<H2>C Specification</H2> 13<DL> 14 <DD> 15<PRE><CODE>#include <revolution/gx.h></CODE></PRE> 16 <DD> 17<PRE><CODE>void GXInitLightDir( 18<A href="../Structures/GXLightObj.html">GXLightObj</A>* lt_obj, 19f32 nx, 20f32 ny, 21f32 nz );</CODE></PRE> 22</DL> 23<H2>Arguments</H2> 24<TABLE border="1" cellpadding="3" cellspacing="0.1"> 25 <TBODY> 26 <TR> 27<TD width="120" bgcolor="#ffffe8"><EM><STRONG><CODE>lt_obj</CODE></STRONG></EM></TD> 28<TD width="520">Pointer to a light object.</TD> 29 </TR> 30 <TR> 31<TD width="120" bgcolor="#ffffe8"><EM><STRONG><CODE>nx</CODE></STRONG></EM></TD> 32<TD width="520">X coordinate for the light direction.</TD> 33 </TR> 34 <TR> 35<TD width="120" bgcolor="#ffffe8"><EM><STRONG><CODE>ny</CODE></STRONG></EM></TD> 36<TD width="520">Y coordinate for the light direction.</TD> 37 </TR> 38 <TR> 39<TD width="120" bgcolor="#ffffe8"><EM><STRONG><CODE>nz</CODE></STRONG></EM></TD> 40<TD width="520">Z coordinate for the light direction</TD> 41 </TR> 42 </TBODY> 43</TABLE> 44<H2>Return Values</H2> 45<P>None.</P> 46<H2>Description</H2> 47<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 <em><code>attn_fn</code></em> parameter of <a href="GXSetChanCtrl.html"><code>GXSetChanCtrl</code></a>). 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 <a href="GXLoadLightObjImm.html"><code>GXLoadLightObjImm</code></a> or <a href="GXLoadLightObjIndx.html"><code>GXLoadLightObjIndx</code></a>.</P> 48<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> 49<P><B>Note:</B> This function can't specify the direction of parallel directional diffuse lights. If you want parallel diffuse lights, you may put the light position very far from every objects to be lit. (See <a href="GXGetLightPos.html"><code>GXInitLightPos</code></a>, <code><a href="GXSetChanCtrl.html">GXSetChanCtrl</a></code> also.)</P> 50<H2>See Also</H2> 51<P><code><a href="GXInitLightPos.html">GXInitLightPos</a><br> <a href="GXLoadLightObjImm.html">GXLoadLightObjImm</a><br> <a href="GXLoadLightObjIndx.html">GXLoadLightObjIndx</a><br> <a href="GXSetChanCtrl.html">GXSetChanCtrl</a><br> <a href="GXGetLightDir.html">GXGetLightDir</a></code></P> 52<P><A href="GXLightObjInitFlow.html">GXLightObj Initialization Flow</A></P> 53<H2>Revision History</H2> 54<P>03/01/2006 Initial version.</P> 55</BODY> 56</HTML>