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>MTXLookAt</TITLE>
9</HEAD>
10<BODY>
11<H1 align="left">MTXLookAt</H1>
12<H2 align="left">C Specification</H2>
13<BLOCKQUOTE><CODE><CODE>#include &lt;revolution/mtx.h&gt;</CODE></CODE></BLOCKQUOTE>
14<BLOCKQUOTE><CODE><CODE>void MTXLookAt (<BR> &nbsp;&nbsp;&nbsp; Mtx &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <EM>m</EM>,<BR> &nbsp;&nbsp;&nbsp; const Point3d* <EM>camPos</EM>,<BR> &nbsp;&nbsp;&nbsp; const Vec*&nbsp;&nbsp;&nbsp;&nbsp; <EM>camUp</EM>,<BR> &nbsp;&nbsp;&nbsp; const Point3d* <EM>target</EM> );</CODE></CODE></BLOCKQUOTE>
15<H2 align="left">Arguments</H2>
16<DIV align="left">
17<TABLE border="1" cellpadding="3" cellspacing="0.1">
18  <TBODY>
19    <TR>
20<TD width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>m</EM></STRONG></CODE></TD>
21<TD width="520">New viewing matrix.&nbsp;<code><em><strong>m</strong></em></code> may be either an <A href="../structures/Mtx_MtxPtr.html"><CODE>Mtx</CODE></a> or an <A href="../structures/Mtx_MtxPtr.html"><CODE>MtxPtr</CODE></a>.</TD>
22    </TR>
23    <TR>
24<TD width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>camPos</EM></STRONG></CODE></TD>
25<TD width="520">Pointer to a <A href="../structures/Point3d_Point3dPtr.html"><CODE>Point3d</CODE></a> giving 3D camera position in world space.</TD>
26    </TR>
27    <TR>
28<TD width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>camUp</EM></STRONG></CODE></TD>
29<TD width="520">Pointer to a <A href="../structures/Vec_VecPtr.html"><CODE>Vec</CODE></a> containing camera &quot;up&quot; vector. <code><em><strong>camUp</strong></em></code> does not have to be a unit vector.</TD>
30    </TR>
31    <TR>
32<TD width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>target</EM></STRONG></CODE></TD>
33<TD width="520">Pointer to a <A href="../structures/Point3d_Point3dPtr.html"><CODE>Point3d</CODE></a> giving 3D target position in world space.</TD>
34    </TR>
35  </TBODY>
36</TABLE>
37</DIV>
38<H2 align="left">Return Values</H2>
39<P align="left">None.</P>
40<H2 align="left">Description</H2>
41<P>Sets a matrix for converting from world space to camera space. Generates the matrix <EM><STRONG><CODE>m</CODE></STRONG></EM> by specifying the camera position (<CODE><EM><STRONG>camPos</STRONG></EM></CODE>), camera &quot;up&quot; direction (<CODE><EM><STRONG>camUp</STRONG></EM></CODE>), and camera focus point (<CODE><EM><STRONG>target</STRONG></EM></CODE>). </P>
42<P>The reference direction for the line-of-sight of the camera is the -Z axis. The reference for the &quot;up&quot; direction of the camera is the +Y axis. </P>
43<P>This function is particularly useful for creating a fixed-position camera which can be aimed at objects, panned, and for which any view can be specified. </P>
44
45
46<H2 align="left">See Also</H2>
47<P align="left"><A href="../structures/Mtx_MtxPtr.html"><CODE>Mtx, MtxPtr</CODE></A>, <A href="../structures/Point3d_Point3dPtr.html"><CODE>Point3d, Point3dPtr</CODE></A>, <CODE><A href="../structures/Vec_VecPtr.html">Vec, VecPtr</A></CODE></P>
48<H2>Revision History</H2>
49<P>2006/03/01 Initial version.</P>
50<hr>
51<P>CONFIDENTIAL</p>
52</BODY>
53</HTML>