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<H2>C Specification</H2> 13<DL> 14 <DD> 15<PRE><CODE>#include <revolution/gx.h></CODE></PRE> 16 <DD> 17<PRE><CODE>void GXInitLightPos( 18<A href="../Structures/GXLightObj.html">GXLightObj</A>* lt_obj, 19f32 x, 20f32 y, 21f32 z );</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>x</CODE></STRONG></EM></TD> 32<TD width="520">returns the X coordinate of position.</TD> 33 </TR> 34 <TR> 35<TD width="120" bgcolor="#ffffe8"><EM><STRONG><CODE>y</CODE></STRONG></EM></TD> 36<TD width="520">returns the Y coordinate of position.</TD> 37 </TR> 38 <TR> 39<TD width="120" bgcolor="#ffffe8"><EM><STRONG><CODE>z</CODE></STRONG></EM></TD> 40<TD width="520">returns the Z coordinate of position.</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 position of the light in the light object. The Revolution 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> 48<P>Although the hardware doesn't support parallel directional diffuse lights, it is possible to get "almost parallel" lights by setting sufficient large values to position parameters (<EM>x</EM>, <EM>y</EM>, and <EM>z</EM>) which makes the light position very far away from objects to be lit and all rays considered almost parallel. You can specify such position parameter in the valid value range which is roughly defined as: <em><code>-1.0E+19 < x, y, z < 1.0E+19</code></em>. Values that exceed this range may cause overflow in the lighting hardware that can lead to unexpected results.</P> 49<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 <a href="GXLoadLightObjImm.html"><code>GXLoadLightObjImm</code></a> or <code><a href="GXLoadLightObjIndx.html">GXLoadLightObjIndx</a></code>.</P> 50<H2>See Also</H2> 51<P><code><a href="GXInitLightDir.html">GXInitLightDir</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="GXGetLightPos.html">GXGetLightPos</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>