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>GXInitLightPosv</TITLE> 9</HEAD> 10<BODY> 11<H1 align="left">GXInitLightPosv</H1> 12 13<H2>Syntax</H2> 14<dl><dd><pre class="construction"> 15#include <revolution/gx.h> 16 17#define GXInitLightPosv(lo, vec) \ 18 (GXInitLightPos((lo), *(f32*)(vec), *((f32*)(vec)+1), *((f32*)(vec)+2))) 19</pre></dd></dl> 20 21<H2>Arguments</H2> 22<TABLE class="arguments" border="1" > 23 <TBODY> 24 <TR> 25<TH>lo</TH> 26<TD>Pointer to a light object.</TD> 27 </TR> 28 <TR> 29<TH>vec</TH> 30<TD>Position vector. You may use an <CODE>f32</CODE>-type array or structure.</TD> 31 </TR> 32 </TBODY> 33</TABLE> 34 35<H2>Return Values</H2> 36<P>None.</P> 37 38<H2>Description</H2> 39<P>This macro function sets the position of the light in the light object using a vector structure. 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> 40<P>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> 41 42<H2>Example</H2> 43<P>You may set an array of <CODE>f32</CODE> values as as the <SPAN class="argument">vec</SPAN> argument.</P> 44<dl><dd><CODE>// Using an array<BR> f32 pos[3] = { 0.0f, 0.0f, 100.0f };<BR> GXLightObj myLightObj;<BR> <BR> GXInitLightPosv( &myLightObj, pos );</CODE></dd></dl> 45<P>You can also use a structure which contains three <CODE>f32</CODE> members (like the matrix-vector library's <CODE>Vec</CODE> type).</P> 46<dl><dd><CODE>// Using a structure<BR> typedef structure<BR> {<BR> f32 x, y, z;<BR> } Point3d;<BR> <BR> Point3d pos;<BR> GXLightObj myLightObj;<BR> <BR> pos.x = pos.y = pos.z = 0.0f;<BR> GXInitLightPosv( &myLightObj, &pos );</CODE></dd></dl> 47 48<H2>See Also</H2> 49<P class="reference"> 50<A href="GXInitLightPos.html">GXInitLightPos</A>, 51<A href="GXLightObjInitFlow.html">GXLightObj Initialization Flow</A> 52</P> 53 54<H2>Revision History</H2> 55<P> 562006/03/01 Initial version.<br> 57</P> 58 59<hr><p>CONFIDENTIAL</p></body> 60</HTML>