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>GXInitLightPos</TITLE> 9</HEAD> 10<BODY> 11<H1 align="left">GXInitLightPos</H1> 12 13<H2>Syntax</H2> 14<dl><dd><pre class="construction"> 15#include <revolution/gx.h> 16 17void GXInitLightPos( 18 <A href="../Structures/GXLightObj.html">GXLightObj</A>* lt_obj, 19 f32 x, 20 f32 y, 21 f32 z ); 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>x</TH> 33<TD>X coordinate of the position.</TD> 34 </TR> 35 <TR> 36<TH>y</TH> 37<TD>Y coordinate of the position.</TD> 38 </TR> 39 <TR> 40<TH>z</TH> 41<TD>Z coordinate of the position.</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 position of the light in the light object. The Wii graphics hardware supports local diffuse lights. The position of the light should be in the same space as a transformed vertex position (i.e., view space).</P> 51<P>Although the hardware does not support parallel directional diffuse lights, it is possible to approximate parallel lights by setting sufficiently large values to position parameters (<SPAN class="argument">x</SPAN>, <SPAN class="argument">y</SPAN>, <SPAN class="argument">z</SPAN>), which makes the light position very far away from objects to be lit and all rays considered almost parallel. You can specify such position parameters within the valid value range, which is roughly <CODE>-1.0E+19</CODE> < <SPAN class="argument">x</SPAN>, <SPAN class="argument">y</SPAN>, <SPAN class="argument">z</SPAN> < <CODE>1.0E+19</CODE>. Values that exceed this range may cause overflow in the lighting hardware that can lead to unexpected results.</P> 52<P>The memory for the light object must be allocated by the application; this function does not load any hardware registers directly. 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> functions.</P> 53 54<H2>See Also</H2> 55<P class="reference"> 56<A href="GXInitLightDir.html">GXInitLightDir</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="GXGetLightPos.html">GXGetLightPos</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>