So this is my thread to post my progress and ask questions relevant to the creation of a 3D engine for Star Trek MP in C. For reference, I started off using this tutorial.

I have gotten up to the segment on the camera. Based on the examples and explanations I have encountered thus far, here is my existing gfx_engine.h file, with datatypes .

Next I have to figure out the rotation matrixes. In this page, the rotation matrices for XY, XZ, and ZY are shown. I get why the shown formulas are used, but how exactly do you do matrix math in C? Would it involve using a multi-dimensional array? Also, once I set up the formulas for each rotation matrix, how would each matrix correspond to movement on an axis? The tutorial seems to gloss over this (unless I'm blind).

I have gotten up to the segment on the camera. Based on the examples and explanations I have encountered thus far, here is my existing gfx_engine.h file, with datatypes .

**Code:**```
```

#ifndef gfx_engine_h

#define gfx_engine_h

// ENGINE TYPEDEFS

typedef struct {

long x;

long y;

long z;

} rend_point_t;

rend_point_t P_AddVectorToPoint(rend_point_t *point, rend_vector_t *vector);

rend_point_t P_SubVectorFromPoint(rend_point_t *point1, rend_point_t *point2);

rend_vector_t P_SubPointFromPoint(rend_point_t *point1, rend_point_t *point2);

void P_SetPointToPoint(rend_point_t *point, long x, long y, long z);

typedef rend_point_t rend_vector_t;

rend_vector_t V_AddVectorToVector(rend_vector_t *vector1, rend_vector_t *vector2);

rend_vector_t V_SubVectorFromVector(rend_vector_t *vector1, rend_vector_t *vector2);

rend_vector_t V_RotateXY(char angle);

rend_vector_t V_RotateYZ(char angle);

rend_vector_t V_RotateXZ(char angle);

rend_vector_t V_Scale(int s0, int s1, int s2);

typedef struct {

int minX, maxX; // drawing window X

int minY, maxY; // drawing window Y

char renderAngle; // FOV

int renderdist; // camera depth

} rend_camera_t;

void CAM_InitTo1stP(rend_camera_t *camera, rend_point_t *point);

void CAM_InitTo3rdP(rend_camera_t *camera, rend_point_t *vector);

void CAM_CullMap(rend_camera_t *camera, MapData_t *map);

#endif

Next I have to figure out the rotation matrixes. In this page, the rotation matrices for XY, XZ, and ZY are shown. I get why the shown formulas are used, but how exactly do you do matrix math in C? Would it involve using a multi-dimensional array? Also, once I set up the formulas for each rotation matrix, how would each matrix correspond to movement on an axis? The tutorial seems to gloss over this (unless I'm blind).