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 align="left">Point3d, Point3dPtr</H1> 12<H2 align="left">C Specification</H2> 13<BLOCKQUOTE><CODE><code>#include <revolution/mtx/GeoTypes.h></CODE></CODE></BLOCKQUOTE> 14<BLOCKQUOTE><CODE><CODE>typedef struct<BR> {<BR> <BR> f32 x, y, z;<BR> <BR> } Vec, *VecPtr, Point3d, *Point3dPtr;</CODE></CODE></BLOCKQUOTE> 15<H2 align="left">Arguments</H2> 16<P align="left">None.</P> 17<H2 align="left">Return Values</H2> 18<P align="left">None.</P> 19<H2 align="left">Description</H2> 20<P><code><strong>Point3d</strong></code> 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 'w' coordinate of 1. For example, to multiply a point (pOld) by a matrix (m): pNew = m x pOld. In code: </P> 21<P align="left"><CODE><A href="../general/MTXMultVec.html">MTXMultVec</A>( m, &pOld, &pNew );</CODE></P> 22<P><code><strong>Point3dPtr</strong></code> is a pointer to a <code><strong>Point3d</strong></code>. It's most often used as a function argument.</P> 23<P><B>Note:</B> <code><strong>Point3d</strong></code> and <A href="Vec_VecPtr.html"><CODE>Vec</CODE></A> are aliases for the same structure. They may be freely interchanged. Two names for the same (x,y,z) triple were created for convenience 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> 24<BLOCKQUOTE><CODE>Point3d p;<BR> VecPtr vPtr = &p; // use a VecPtr to point to a Point3d</CODE></BLOCKQUOTE> 25<BLOCKQUOTE><CODE>MTXMultVec( m, vPtr, vPtr );<BR> MTXMultVec( m, &p, &p ); // use a Point3dPtr in place of a VecPtr</CODE></BLOCKQUOTE> 26 27 28<H2 align="left">See Also</H2> 29<P align="left"><A href="Mtx_MtxPtr.html">Mtx, MtxPtr</A>, <A href="Vec_VecPtr.html">Vec, VecPtr</A>, <A href="../general/MTXMultVec.html">MTXMultVec</A>, <A href="../general/MTXMultVecArray.html">MTXMultVecArray</A>, <A href="../vector/VECAdd.html">VECAdd</A>, <A href="../vector/VECCrossProduct.html">VECCrossProduct</A>, <A href="../vector/VECDotProduct.html">VECDotProduct</A>, <A href="../vector/VECHalfAngle.html">VECHalfAngle</A>, <A href="../vector/VECMag.html">VECMag</A>, <A href="../vector/VECNormalize.html">VECNormalize</A>, <A href="../vector/VECReflect.html">VECReflect</A>, <A href="../vector/VECScale.html">VECScale</A>, <A href="../vector/VECSubtract.html">VECSubtract</A></P> 30<H2>Revision History</H2> 31<P>03/01/2006 Initial version.</P> 32</BODY> 33</HTML>