Point3d, Point3dPtr

Syntax

#include <revolution/mtx/GeoTypes.h>

typedef struct
{

    f32 x, y, z;

} Vec, *VecPtr, Point3d, *Point3dPtr;

Arguments

None.

Return Values

None.

Description

Point3d 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. This is done as follows in a program.

MTXMultVec( m, &pOld, &pNew );

Point3dPtr is a pointer to a Point3d. It's most often used as a function argument.

Be aware that Point3d and Vec are aliases for the same structure. They may be freely interchanged. 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:

Point3d p;
VecPtr vPtr = &p;                  // use a VecPtr to point to a Point3d

MTXMultVec( m, vPtr,  vPtr );
MTXMultVec( m, &p,   &p );         // use a Point3dPtr in place of a VecPtr

See Also

Mtx, MtxPtr, Vec, VecPtr, MTXMultVec, MTXMultVecArray, VECAdd, VECCrossProduct , VECDotProduct, VECHalfAngle, VECMag, VECNormalize, VECReflect, VECScale, VECSubtract

Revision History

2006/03/01 Initial version.


CONFIDENTIAL