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>Point3d, Point3dPtr</TITLE>
9</HEAD>
10<BODY>
11<H1>Point3d, Point3dPtr</H1>
12
13<H2>Syntax</H2>
14<dl><dd><pre class="construction">
15#include &lt;revolution/mtx/GeoTypes.h&gt;
16
17typedef struct
18{
19
20&nbsp;&nbsp;&nbsp; f32 x, y, z;
21
22} Vec, *VecPtr, Point3d, *Point3dPtr;
23</pre></dd></dl>
24
25<H2>Arguments</H2>
26<P>None.</P>
27
28<H2>Return Values</H2>
29<P>None.</P>
30
31<H2>Description</H2>
32<P><STRONG>Point3d</STRONG> is a three-dimensional point with x, y and z components. When used in 3D transformations, it is treated as a column vector with an implied fourth <EM>w</EM> coordinate of 1. For example, to multiply a point (<CODE>pOld</CODE>) by a matrix (<CODE>m</CODE>): <CODE>pNew = m x pOld</CODE>. This is done as follows in a program.</P>
33<dl><dd><pre class="construction">
34<A href="../general/MTXMultVec.html">MTXMultVec</A>( m, &amp;pOld, &amp;pNew );
35</pre></dd></dl>
36<P><STRONG>Point3dPtr</STRONG> is a pointer to a <STRONG>Point3d</STRONG>. It's most often used as a function argument.</P>
37<P>Be aware that <STRONG>Point3d</STRONG> and <A href="Vec_VecPtr.html"><CODE>Vec</CODE></A> are aliases for the same structure. They may be freely interchanged.&nbsp;Two names for the same (x,y,z) set were created for convenience. This is because sometimes it is more natural to think of an x,y,z coordinate as a vector (normal), and sometimes as a point (vertex). For example:</P>
38<dl><dd><pre class="construction">
39Point3d p;
40VecPtr vPtr = &p;                  // use a VecPtr to point to a Point3d
41
42MTXMultVec( m, vPtr,  vPtr );
43MTXMultVec( m, &amp;p,   &amp;p );         // use a Point3dPtr in place of a VecPtr
44</pre></dd></dl>
45
46<H2>See Also</H2>
47<P class="reference">
48<A href="Mtx_MtxPtr.html">Mtx, MtxPtr</A>,
49<A href="Vec_VecPtr.html">Vec, VecPtr</A>,
50<A href="../general/MTXMultVec.html">MTXMultVec</A>,
51<A href="../general/MTXMultVecArray.html">MTXMultVecArray</A>,
52<A href="../vector/VECAdd.html">VECAdd</A>,
53<A href="../vector/VECCrossProduct.html">VECCrossProduct</A> ,
54<A href="../vector/VECDotProduct.html">VECDotProduct</A>,
55<A href="../vector/VECHalfAngle.html">VECHalfAngle</A>,
56<A href="../vector/VECMag.html">VECMag</A>,
57<A href="../vector/VECNormalize.html">VECNormalize</A>,
58<A href="../vector/VECReflect.html">VECReflect</A>,
59<A href="../vector/VECScale.html">VECScale</A>,
60<A href="../vector/VECSubtract.html">VECSubtract</A>
61</P>
62
63<H2>Revision History</H2>
64<P>
652006/03/01 Initial version.<BR>
66</P>
67
68<hr><p>CONFIDENTIAL</p></body>
69</HTML>